Structs

The following structs are available globally.

  • Error that is thrown when a validation fails. Proivdes the validator type and the value that failed validation

    See more

    Declaration

    Swift

    public struct ValidatorError: Error, CustomStringConvertible
  • 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.

    See more

    Declaration

    Swift

    public struct Validated<V: Validator>: ValidatedType
  • And

    Validator wrapper which is valid when V1 and V2 validated to true.

    See more

    Declaration

    Swift

    public struct And<
        V1: Validator,
        V2: Validator>: Validator where
        V1.WrappedType == V2.WrappedType
  • Or

    Validator wrapper which is valid when either V1 or V2 validated to true.

    See more

    Declaration

    Swift

    public struct Or<
        V1: Validator,
        V2: Validator>: Validator where
        V1.WrappedType == V2.WrappedType
  • Not

    Validator wrapper which is valid when V1 validated to false.

    See more

    Declaration

    Swift

    public struct Not<V1: Validator>: Validator