StatefulDecoder
public protocol StatefulDecoder : StatefulCoder
An object that reconstitutes values from a serialized Encoding, maintaining state across the
deserialization of individual parts.
Note
this protocol matches Foundation’sXXXEncoder types, which—confusingly—do not
themselves conform to the Encoder protocol.
-
Returns the
Tvalue that was serialized intoarchive.Declaration
Swift
func decode<T>(_ type: T.Type, from archive: Encoding) throws -> T where T : Decodable -
decode(_:Extension methodfrom: startState: ) Returns the
Tvalue that was serialized intoarchive, usingstartStateas the initial decoding state.Declaration
Swift
public mutating func decode<T, State: Sendable>(_ type: T.Type, from encodedT: Encoding, startState: State) throws -> T where T: Decodable
View on GitHub