CompoundConstraint
public struct CompoundConstraint<T, E> : Constraint where E : Error
Undocumented
-
Undocumented
See moreDeclaration
Swift
public enum Mode
-
Declaration
Swift
public typealias InputType = T
-
Declaration
Swift
public typealias ErrorType = E
-
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>(_ mode: Mode = .all, constraints: [C]) where T == C.InputType, E == C.ErrorType, C : Constraint
Parameters
constraints
[Constraint]
-
Create a new
AndCompoundConstraint
instance populated with a predefined list ofConstraints
Declaration
Swift
public init<C>(_ mode: Mode = .all, constraints: C...) where T == C.InputType, E == C.ErrorType, C : Constraint
Parameters
constraints
[Constraint]
-
Evaluates the input on the sub-constraints.
Declaration
Swift
public func evaluate(with input: T) -> Result<Void, Summary<E>>
Parameters
input
The input to be validated.
Return Value
.success
if the input is valid,.failure
containing theSummary
of the failingConstraint
s otherwise.
-
Create a new
CompoundConstraint
instance populated with a predefined list ofConstraints
Declaration
Swift
public init(_ mode: Mode = .all, @ConstraintBuilder<T, E> constraintBuilder: () -> [AnyConstraint<T, E>])
Parameters
constraints
[Constraint]