GroupConstraint

public struct GroupConstraint<T, E> : Constraint where E : Error
  • Declaration

    Swift

    public enum Mode
  • Declaration

    Swift

    public typealias InputType = T
  • Declaration

    Swift

    public typealias ErrorType = E
  • Returns the number of constraints in the group.

    Declaration

    Swift

    public var count: Int { get }
  • Returns a new AndCompoundConstraint instance populated with a predefined list of Constraints.

    Declaration

    Swift

    public init(_ mode: Mode = .all, constraints: [some Constraint<T, E>])

    Parameters

    constraints

    [Constraint]

  • Evaluates the input on the underlying 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 the Summary of the failing Constraints otherwise.

ConstraintBuilder Extension