CompoundContraint
public struct CompoundContraint<T> : Constraint
Undocumented
-
Declaration
Swift
public typealias InputType = T
-
Returns the number of constraints in collection
Declaration
Swift
public var count: Int { get }
-
Create a new
AndCompoundConstraint
instance populated with a predefined list ofConstraints
Declaration
Swift
public init<C>(allOf subconstraints: [C]) where T == C.InputType, C : Constraint
Parameters
constraints
[Constraint]
-
Create a new
AndCompoundConstraint
instance populated with a predefined list ofConstraints
Declaration
Swift
public init<C>(allOf subconstraints: C...) where T == C.InputType, C : Constraint
Parameters
constraints
[Constraint]
-
Create a new
OrConstraint
instance populated with a predefined list ofConstraints
Declaration
Swift
public init<C>(anyOf subconstraints: [C]) where T == C.InputType, C : Constraint
Parameters
constraints
[Constraint]
-
Create a new
OrConstraint
instance populated with a predefined list ofConstraints
Declaration
Swift
public init<C>(anyOf subconstraints: C...) where T == C.InputType, C : Constraint
Parameters
constraints
[Constraint]
-
Evaluates the input on the subconstraints.
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.