SwiftclassFoundation
class Foundation.JSONEncoder
Structure
What a query’s scopes step through. Every node here can be matched — see the syntax.
inherits{}
- protocolCombine.TopLevelEncoder
Members 14
- deinit
deinit - field
var options: Foundation.JSONEncoder._Options+0x10 - field
let optionsLock: Synchronization.Mutex<()> - func
encode<A where A: Encodable>(A) throws -> Foundation.Data - func
encode<A where A: Foundation.EncodableWithConfiguration>(_: A, configuration: A.EncodingConfiguration) throws -> Foundation.Data - func
encode<A, B where A: Foundation.EncodableWithConfiguration, B: Foundation.EncodingConfigurationProviding, A.EncodingConfiguration == B.EncodingConfiguration>(_: A, configuration: B.Type) throws -> Foundation.Data - init
Foundation.JSONEncoder.__allocating_init() -> Foundation.JSONEncoder - typealias
typealias Output = Foundation.Data - var
var dataEncodingStrategy: Foundation.JSONEncoder.DataEncodingStrategy { get set } - var
var dateEncodingStrategy: Foundation.JSONEncoder.DateEncodingStrategy { get set } - var
var keyEncodingStrategy: Foundation.JSONEncoder.KeyEncodingStrategy { get set } - var
var nonConformingFloatEncodingStrategy: Foundation.JSONEncoder.NonConformingFloatEncodingStrategy { get set } - var
var outputFormatting: Foundation.JSONEncoder.OutputFormatting { get set } - var
var userInfo: [CodingUserInfoKey : Any] { get set }
Header
@_objcRuntimeName(_TtC10Foundation13__JSONEncoder) class JSONEncoder { struct OutputFormatting { let rawValue: Swift.UInt static var prettyPrinted: Foundation.JSONEncoder.OutputFormatting { get } static var sortedKeys: Foundation.JSONEncoder.OutputFormatting { get } static var withoutEscapingSlashes: Foundation.JSONEncoder.OutputFormatting { get } } enum DateEncodingStrategy { case formatted(__C.NSDateFormatter) case custom(@Sendable (Foundation.Date, any Swift.Encoder) throws -> ()) case deferredToDate case secondsSince1970 case millisecondsSince1970 case iso8601 } enum DataEncodingStrategy { case custom(@Sendable (Foundation.Data, any Swift.Encoder) throws -> ()) case deferredToData case base64 } enum NonConformingFloatEncodingStrategy { case convertToString(positiveInfinity: Swift.String, negativeInfinity: Swift.String, nan: Swift.String) case throw } enum KeyEncodingStrategy { case custom(@Sendable (_: [any Swift.CodingKey]) -> any Swift.CodingKey) case useDefaultKeys case convertToSnakeCase } struct _Options { var outputFormatting: Foundation.JSONEncoder.OutputFormatting var dateEncodingStrategy: Foundation.JSONEncoder.DateEncodingStrategy var dataEncodingStrategy: Foundation.JSONEncoder.DataEncodingStrategy var nonConformingFloatEncodingStrategy: Foundation.JSONEncoder.NonConformingFloatEncodingStrategy var keyEncodingStrategy: Foundation.JSONEncoder.KeyEncodingStrategy var userInfo: [Swift.CodingUserInfoKey : Any] } var options: Foundation.JSONEncoder._Options let optionsLock: Synchronization.Mutex<()> var outputFormatting: Foundation.JSONEncoder.OutputFormatting { get set } var dateEncodingStrategy: Foundation.JSONEncoder.DateEncodingStrategy { get set } var dataEncodingStrategy: Foundation.JSONEncoder.DataEncodingStrategy { get set } var nonConformingFloatEncodingStrategy: Foundation.JSONEncoder.NonConformingFloatEncodingStrategy { get set } var keyEncodingStrategy: Foundation.JSONEncoder.KeyEncodingStrategy { get set } var userInfo: [Swift.CodingUserInfoKey : Any] { get set } init() func encode<A>(_: A) throws -> Foundation.Data where A: Swift.Encodable func encode<A>(_: A, configuration: A.EncodingConfiguration) throws -> Foundation.Data where A: Foundation.EncodableWithConfiguration func encode<A, B>(_: A, configuration: B.Type) throws -> Foundation.Data where A: Foundation.EncodableWithConfiguration, B: Foundation.EncodingConfigurationProviding, A.EncodingConfiguration == B.EncodingConfiguration deinit }