Validated

public struct Validated<V: Validator>: ValidatedType

Wraps a type together with one validator. Provides a failable initializer that will only return a value of Validated if the provided WrapperType value fulfills the requirements of the specified Validator.

  • The value that passes the defined Validator.

    If you are able to access this property; it means the wrappedType passes the validator.

    Declaration

    Swift

    public let value: ValidatorType.WrappedType
  • Throwing initializer that will not throw an error if the provided value fulfills the requirements specified by the Validator.

    Declaration

    Swift

    public init(_ value: WrapperType) throws
  • Failible initializer that will only succeed, if the provided value fulfills the requirements specified by the Validator.

    Declaration

    Swift

    public init?(value: WrapperType)