TypeConstraint

public struct TypeConstraint<T> : Constraint

Undocumented

  • Create a new CollectionConstraint instance

    Declaration

    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 provided KeyPath.

    keyPath

    The KeyPath for the property we set the Constraint on.

  • Evaluates the input on the set key pathConstraints.

    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 the Summary of the failing Constraints otherwise.