decode(_:as:)
Use the default configured decoder for the contentType
parameter to read a value of type D
from the container.
func decode<D>(_: D.Type, as contentType: HTTPMediaType) throws -> D where D : Decodable
Use the default configured decoder for the contentType
parameter to read a value of type D
from the container.
func decode<D>(_: D.Type, as contentType: HTTPMediaType) throws -> D where D : Decodable
s5Vapor16ContentContainerPAAE6decode_2asqd__qd__m_AA13HTTPMediaTypeVtKSeRd__lF
What are these?8T4K1
import Vapor
Vapor is a framework for building server applications, APIs and websites in Swift. It provides a safe, performant and scalable foundation for building large complex backends.
protocol ContentContainer
var contentType: HTTPMediaType? { get }
The type of data stored in the container.
struct HTTPMediaType
Represents an encoded data-format, used in HTTP, HTML, email, and elsewhere.
protocol Decodable
A type that can decode itself from an external representation.
subscript<D>(path: CodingKeyRepresentable...) -> D? where D : Decodable { get }
Legacy alias for subscript(_:at:)-90mrm
.
subscript<D>(_: D.Type = D.self, at path: [CodingKeyRepresentable]) -> D? where D : Decodable { get }
Fetch a single Decodable
value at the supplied keypath in the container.
subscript<D>(_: D.Type = D.self, at path: CodingKeyRepresentable...) -> D? where D : Decodable { get }
Fetch a single Decodable
value at the supplied keypath in the container.
func decode<C>(_: C.Type) throws -> C where C : Content
Use the default decoder for the container’s contentType
to read a value of type C
from the container.
func decode<D>(_: D.Type) throws -> D where D : Decodable
Use the default decoder for the container’s contentType
to read a value of type D
from the container.
mutating func encode<C>(_ content: C) throws where C : Content
Serialize a Content
object to the container as its default content type.
mutating func encode<C>(_ content: inout C) throws where C : Content
Serialize a Content
object to the container as its default content type without copying it.
mutating func encode<C>(_ content: C, as contentType: HTTPMediaType) throws where C : Content
Serialize a Content
object to the container, specifying an explicit content type.
mutating func encode<E>(_ encodable: E, as contentType: HTTPMediaType) throws where E : Encodable
Serialize an Encodable
value to the container as the given HTTPMediaType
.
mutating func encode<C>(_ content: inout C, as contentType: HTTPMediaType) throws where C : Content
Serialize a Content
object to the container without copying it, specifying an explicit content type.
func get<D>(_: D.Type = D.self, at path: [CodingKeyRepresentable]) throws -> D where D : Decodable
Fetch a single Decodable
value at the supplied keypath in this container.
func get<D>(_: D.Type = D.self, at path: CodingKeyRepresentable...) throws -> D where D : Decodable
Fetch a single Decodable
value at the supplied keypath in the container.