Vapor Documentation Beta

Protocol Optional​Type

public protocol OptionalType: AnyOptionalType

Capable of being represented by an optional wrapped type.

This protocol mostly exists to allow constrained extensions on generic types where an associatedtype is an Optional<T>.

%3 OptionalType OptionalType AnyOptionalType AnyOptionalType OptionalType->AnyOptionalType

Conforms To

AnyOptionalType

Type-erased OptionalType

Requirements

wrapped

var wrapped: WrappedType?

Returns the wrapped type, if it exists.

make​Optional​Type(_:​)

static func makeOptionalType(_ wrapped: WrappedType?) -> Self

Creates this optional type from an optional wrapped type.