Dictionary (ext)
You’re viewing third-party extensions to Dictionary
, a struct from the Swift standard library.
You can also read the documentation forDictionary
itself.
extension Dictionary
You’re viewing third-party extensions to Dictionary
, a struct from the Swift standard library.
You can also read the documentation forDictionary
itself.
extension Dictionary
@frozen struct Dictionary<Key, Value> where Key : Hashable
A collection whose elements are key-value pairs.
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.
@frozen struct String
A Unicode string value that is a collection of characters.
protocol Content : Decodable, Encodable, AsyncRequestDecodable, AsyncResponseEncodable, RequestDecodable, ResponseEncodable
Convertible to / from content in an HTTP message.
protocol AsyncRequestDecodable
Can convert Request
to a Self
.
protocol AsyncResponseEncodable
Can convert self
to a Response
.
protocol RequestDecodable
Can convert Request
to a Self
.
protocol ResponseEncodable
Can convert self
to a Response
.
static var defaultContentType: HTTPMediaType { get }
static var defaultContentType: HTTPMediaType { get }
static func decodeRequest(_ request: Request) -> EventLoopFuture<Self>
static func decodeRequest(_ request: Request) async throws -> Self
mutating func afterDecode() throws
mutating func beforeEncode() throws
func encodeResponse(for request: Request) -> EventLoopFuture<Response>
func encodeResponse(for request: Request) async throws -> Response
func encodeResponse(status: HTTPStatus, headers: HTTPHeaders = [:], for request: Request) -> EventLoopFuture<Response>
Asynchronously encodes Self
into a Response
, setting the supplied status and headers.
func encodeResponse(status: HTTPStatus, headers: HTTPHeaders = [:], for request: Request) async throws -> Response
Asynchronously encodes Self
into a Response
, setting the supplied status and headers.