Context
The context in which the error occurred.
You’re reading documentation from an older version of Swift 6.1.
A symbol with the same signature as this one exists in the latest stable release of Swift 6.1.
struct ContextThe context in which the error occurred.
You’re reading documentation from an older version of Swift 6.1.
A symbol with the same signature as this one exists in the latest stable release of Swift 6.1.
struct Contextimport Swiftenum DecodingErrorAn error that occurs during the decoding of a value.
static func dataCorruptedError<C>(forKey key: C.Key, in container: C, debugDescription: String) -> DecodingError where C : KeyedDecodingContainerProtocol Returns a new .dataCorrupted error using a constructed coding path and the given debug description.
static func dataCorruptedError(in container: any SingleValueDecodingContainer, debugDescription: String) -> DecodingError Returns a new .dataCorrupted error using a constructed coding path and the given debug description.
static func dataCorruptedError(in container: any UnkeyedDecodingContainer, debugDescription: String) -> DecodingError Returns a new .dataCorrupted error using a constructed coding path and the given debug description.
protocol Sendableinit(codingPath: [any CodingKey], debugDescription: String, underlyingError: (any Error)? = nil) Creates a new context with the given path of coding keys and a description of what went wrong.
let codingPath: [any CodingKey]The path of coding keys taken to get to the point of the failing decode call.
let debugDescription: StringA description of what went wrong, for debugging purposes.
let underlyingError: (any Error)?The underlying error which caused this error, if any.