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.
Declaration
Swift
public func evaluate(with input: InputType) -> ValidationResult
Parameters
input
The input to be validated.
Return Value
.success
if the input is valid,.failure
containing theSummary
of the failingConstraint
s otherwise.