TypeConstraint
public struct TypeConstraint<T> : Constraint
Undocumented
-
Create a new
CollectionConstraint
instanceDeclaration
Swift
public init()
-
Set a
Constraint
on a property from the root object.Declaration
Swift
public mutating func set<C, V>(_ constraint: C, for keyPath: KeyPath<T, V>) where C : Constraint, V == C.InputType
Parameters
constraint
A
Constraint
on the property at the providedKeyPath
.keyPath
The
KeyPath
for the property we set theConstraint
on. -
Evaluates the input on the set key path
Constraint
s.Declaration
Swift
public func evaluate(with input: T) -> Result
Parameters
input
The input to be validated.
Return Value
.success
if the input is valid,.failure
containing theSummary
of the failingConstraint
s otherwise.