Protocol
ContentContainer
protocol ContentContainer
Topics
Instance Properties
var contentConfiguration: ContentConfigurationThe configuration for encoding and decoding content.var contentType: HTTPMediaType?The type of data stored in the container.
Instance Methods
func decode(_:)Use the default decoder for the container’scontentTypeto read a value of typeCfrom the container.func decode(_:as:)Use the default configured decoder for thecontentTypeparameter to read a value of typeCfrom the container.func decode<D>(D.Type, using: any ContentDecoder) async throws -> DUse the providedContentDecoderto read a value of typeDfrom the container.func encode(_:)Serialize aContentobject to the container as its default content type.func encode(_:as:)Serialize aContentobject to the container without copying it, specifying an explicit content type.func encode(some Encodable, using: any ContentEncoder) throwsUse the providedContentEncoderto write a value of typeEto the container.func get(_:at:)Fetch a singleDecodablevalue at the supplied keypath in this container.
Subscripts
subscript(_:at:)Fetch a singleDecodablevalue at the supplied keypath in the container.