Vapor Documentation Beta

Classes

Application
Application.​Locks
BCrypt​Digest

Creates and verifies BCrypt hashes. Normally you will not need to initialize one of these classes and you will use the global BCrypt convenience instead.

Boot​Command

Boots the Application then exits successfully.

Routes​Command

Displays all routes registered to the Application's Router in an ASCII-formatted table.

Serve​Command

Boots the application's server. Listens for SIGINT and SIGTERM for graceful shutdown.

Endpoint​Cache

Handles the complexities of HTTP caching.

HTTPServer
CORSMiddleware

Middleware that adds support for CORS settings in request responses. For configuration of this middleware please use the CORSMiddleware.Configuration object.

Error​Middleware

Captures all errors and transforms them into an internal server error HTTP response.

File​Middleware

Serves static files from a public directory.

Multipart​Parser

Parses multipart-encoded Data into MultipartParts. Multipart encoding is a widely-used format for encoding/// web-form data that includes rich content like files. It allows for arbitrary data to be encoded in each part thanks to a unique delimiter "boundary" that is defined separately. This boundary is guaranteed by the client to not appear anywhere in the data.

Multipart​Serializer

Serializes MultipartForms to Data.

Request
Response

An HTTP response from a server back to the client.

Route
Routes
Memory​Sessions.​Storage
Session

Sessions are a method for associating data with a client accessing your app.

Sessions​Middleware

Uses HTTP cookies to save and restore sessions for connecting clients.

Structures

Application.​Lifecycle
Request.​Authentication

Request helper for storing and fetching authenticated objects.

Basic​Authorization

A basic username and password.

Bearer​Authorization

A bearer token.

Application.​Clients
Application.​Clients.​Provider
Client​Request
Client​Response
Boot​Command.​Signature

See Command.

Routes​Command.​Signature
Serve​Command.​Signature
Content​Configuration

Configures which Encoders and Decoders to use when interacting with data in HTTP messages.

Plaintext​Encoder

Encodes data as plaintext, utf8.

Application.​Core
Application.​Running
Environment.​Process

The process information of an environment. Wraps ProcessInto.processInfo.

Environment

The environment the application is running in, i.e., production, dev, etc. All Containers will have an Environment that can be used to dynamically register and configure services.

Abort

Default implementation of AbortError. You can use this as a convenient method for throwing AbortErrors without having to conform your own error-type to AbortError.

Error​Source

A source-code location.

Stack​Trace
Stack​Trace.​Frame
Application.​HTTP
Basic​Responder

A basic, closure-based Responder.

Application.​HTTP.​Client
HTTPCookies

A collection of HTTPCookies.

HTTPCookies.​Value

A single cookie (key/value pair).

HTTPHeaders.​Cache​Control

Represents the HTTP Cache-Control header.

HTTPHeaders.​Cache​Control.​Max​Stale

The max-stale option can be present with no value, or be present with a number of seconds. By using a struct you can check the nullability of the maxStale variable as well as then check the nullability of the seconds to differentiate.

HTTPHeaders.​Expires
HTTPHeaders.​Last​Modified

Represents the HTTP Last-Modified header.

HTTPHeaders.​Content​Disposition
HTTPHeaders.​Content​Disposition.​Value
HTTPHeaders.​Forwarded

Parses the Forwarded header.

HTTPHeaders.​Name

Type used for the name of a HTTP header in the HTTPHeaders storage.

HTTPMedia​Type

Represents an encoded data-format, used in HTTP, HTML, email, and elsewhere.

HTTPMedia​Type​Preference

Represents a MediaType and its associated preference, q.

Application.​HTTP.​Server
HTTPServer.​Configuration

Engine server config struct.

HTTPServer.​Configuration.​Compression​Configuration

Supported HTTP compression options.

HTTPServer.​Configuration.​Decompression​Configuration

Supported HTTP decompression options.

CORSMiddleware.​Configuration

Configuration used for populating headers in response for CORS requests.

Middlewares

Configures an application's active Middleware. Middleware will be used in the order they are added.

Form​Data​Decoder

Decodes Decodable types from multipart/form-data encoded Data.

Form​Data​Encoder

Encodes Encodable items to multipart/form-data encoded Data.

Multipart​Part

A single part of a multipart-encoded message.

Application.​Password
Application.​Passwords
Application.​Passwords.​Provider
Async​Password​Hasher
Request.​Password
Request.​Body
Application.​Responder
Application.​Responder.​Provider
Response.​Body

Represents a Response's body.

Web​Socket​Max​Frame​Size
Application.​Servers
Application.​Servers.​Provider
Application.​Sessions
Application.​Sessions.​Provider
Memory​Sessions

Simple in-memory sessions implementation.

Session​ID
Session​Data

Codable session data.

Sessions​Configuration

Configuration options for sessions.

URLEncoded​Form​Decoder

Decodes instances of Decodable types from application/x-www-form-urlencoded Data.

URLEncoded​Form​Decoder.​Configuration

Used to capture URLForm Coding Configuration used for decoding

URLEncoded​Form​Encoder

Encodes Encodable instances to application/x-www-form-urlencoded data.

URLEncoded​Form​Encoder.​Configuration

Used to capture URLForm Coding Configuration used for encoding.

Any​Response

A type erased response useful for routes that can return more than one type.

Byte​Count

Represents a number of bytes:

Decoder​Unwrapper
Directory​Configuration

DirectoryConfiguration represents a configured working directory. It can also be used to derive a working directory automatically.

Dot​Env​File

Reads dotenv (.env) files and loads them into the current process.

Dot​Env​File.​Line

Represents a KEY=VALUE pair in a dotenv file.

Extend

A wrapper around a simple [String: Any] storage dictionary used to implement Extendable.

File

Represents a single file.

File​IO

FileIO is a convenience wrapper around SwiftNIO's NonBlockingFileIO.

Storage
URI
Validation
Validation​Result
Validations
Validations​Result
Validations​Error
Validator
Validator​Results
Validator​Results.​Nested
Validator​Results.​Skipped
Validator​Results.​Missing
Validator​Results.​Not​Found
Validator​Results.​Codable
Validator​Results.​Invalid
Validator​Results.​Type​Mismatch
Validator​Results.​And

ValidatorResult of "And" Validator that combines two ValidatorResults. If both results are successful the combined result is as well.

Validator​Results.​Case

ValidatorResult of a validator thaat validates whether the data can be represented as a specific Enum case.

Validator​Results.​Character​Set

ValidatorResult of a validator that validates that a String contains characters in a given CharacterSet.

Validator​Results.​Email

ValidatorResult of a validator that validates whether a String is a valid email address.

Validator​Results.​Empty

ValidatorResult of a validator that validates whether the data is empty.

Validator​Results.​In

ValidatorResult of a validator that validates whether an item is contained in the supplied sequence.

Validator​Results.​Nil

ValidatorResult of a validator that validates that the data is nil.

Validator​Results.​Nil​Ignoring

ValidatorResult of a validator that ignores nil values.

Validator​Results.​Not
Validator​Results.​Or

ValidatorResult of "Or" Validator that combines two ValidatorResults. If either result is successful the combined result is as well.

Validator​Results.​Range

ValidatorResult of a validator that validates whether the input is within a supplied range.

Validator​Results.​URL

ValidatorResult of a validator that validates whether a string is a valid URL.

Validator​Results.​Valid

ValidatorResult of a validator that validates that the data is valid`.

Application.​Views
Application.​Views.​Provider
Plaintext​Renderer
View

Enumerations

Application.​Event​Loop​Group​Provider
Bcrypt​Error
Help​Format

Available formatting options for generating debug info for Debuggable errors.

Body​Stream​Result
Endpoint​Cache​Error
HTTPCookies.​Same​Site​Policy

A cookie which can only be sent in requests originating from the same origin as the target domain.

HTTPVersion​Major
CORSMiddleware.​Allow​Origin​Setting

Option for the allow origin header in responses for CORS requests.

Multipart​Error

Errors that can be thrown while working with Multipart.

Redirect​Type

Specifies the type of redirect that the client should receive.

HTTPBody​Stream​Strategy

Determines how an incoming HTTP request's body is collected.

URLEncoded​Form​Decoder.​Configuration.​Date​Decoding​Strategy

Supported date formats

URLEncoded​Form​Encoder.​Configuration.​Array​Encoding

Supported array encodings.

URLEncoded​Form​Encoder.​Configuration.​Date​Encoding​Strategy

Supported date formats

Basic​Coding​Key

A basic CodingKey implementation.

Range​Result

Type used by Range and Count validators to indicate where a value fell within a range.

Validation​Key

Protocols

Lock​Key
Authenticatable

Capable of being authenticated.

Authenticator

Helper for creating authentication middleware.

Request​Authenticator

Help for creating authentication middleware based on Request.

Basic​Authenticator

Helper for creating authentication middleware using the Basic authorization header.

Bearer​Authenticator

Helper for creating authentication middleware using the Bearer authorization header.

Credentials​Authenticator

Helper for creating authentication middleware using request body contents.

Session​Authenticator

Helper for creating authentication middleware in conjunction with SessionsMiddleware.

Session​Authenticatable

Models conforming to this protocol can have their authentication status cached using SessionAuthenticator.

Client
Content

Convertible to / from content in an HTTP message.

Content​Encoder
Content​Decoder
Content​Container
URLQuery​Decoder
URLQuery​Encoder
URLQuery​Container

Helper for encoding and decoding data from an HTTP request query string.

Abort​Error

Errors conforming to this protocol will always be displayed by Vapor to the end-user (even in production mode where most errors are silenced).

Debuggable​Error

Debuggable provides an interface that allows a type to be more easily debugged in the case of an error.

Body​Stream​Writer
Responder
Middleware

Middleware is placed between the server and your router. It is capable of mutating both incoming requests and outgoing responses. Middleware can choose to pass requests on to the next Middleware in a chain, or they can short circuit and return a custom Response if desired.

Multipart​Part​Convertible
Password​Hasher
Response​Encodable

Can convert self to a Response.

Request​Decodable
Route​Collection

Groups collections of routes together for adding to a router.

Routes​Builder
Server
Session​Driver

Capable of managing CRUD operations for Sessions.

Coding​Key​Representable

Capable of being represented by a CodingKey.

Extendable

Types conforming to Extendable can have stored properties added in extension by using the Extend struct.

Lifecycle​Handler
Optional​Type

Capable of being represented by an optional wrapped type.

Any​Optional​Type

Type-erased OptionalType

Storage​Key
Validatable

Capable of being validated. Conformance adds a throwing validate() method.

Validator​Result
View​Renderer

Typealiases

HTTPStatus

Less verbose typealias for HTTPResponseStatus.

Functions

_stdlib_demangle​Impl(mangled​Name:​mangled​Name​Length:​output​Buffer:​output​Buffer​Size:​flags:​)

Here be dragons! _stdlib_demangleImpl is linked into the stdlib. Use at your own risk!

Variables

Bcrypt

Creates and verifies BCrypt hashes.