Instance Method

and(_:)

Produces a new Validator by combining self with another validator using “and” logic.

Declaration

func and<V>(_ other: V) -> Validator<Self.T> where V : ValidatorExpressible, Self.T == V.T

Return Value

A new Validator.

Parameters

other

A Validator to combine with self.

Discussion

The resulting validator fails if either of the validators fail. Failures from both validators are combined.