AnyConstraint
public struct AnyConstraint<T> : Constraint
A type-erased Constraint
.
-
A type that provides information about what kind of values the constraint can be evaluated with.
Declaration
Swift
public typealias InputType = T
-
Creates a type-erased
Constraint
that wraps the given instance.Declaration
Swift
public init<C>(_ constraint: C) where T == C.InputType, C : Constraint
-
Evaluates the input against the receiver.
Parameters
input
The input to be validated.
Return Value
.valid
if the input is valid,.invalid
containing theResult.Summary
of the failingConstraint
s otherwise.