YAMLEncoder
public class YAMLEncoder
Codable-style Encoder that can be used to encode an Encodable type to a YAML string using optional
user info mapping. Similar to Foundation.JSONEncoder.
-
Options to use when encoding to YAML.
Declaration
Swift
public typealias Options = Emitter.Options -
Options to use when encoding to YAML.
Declaration
Swift
public var options: YAMLEncoder.Options -
Creates a
YAMLEncoderinstance.Declaration
Swift
public init() -
Encode a value of type
Tto a YAML string.Throws
EncodingErrorif something went wrong while encoding.Declaration
Swift
public func encode<T>(_ value: T, userInfo: [CodingUserInfoKey : Any] = [:]) throws -> String where T : EncodableParameters
valueValue to encode.
userInfoAdditional key/values which can be used when looking up keys to encode.
Return Value
The YAML string.
View on GitHub
Install in Dash