AutoTraversal

public protocol AutoTraversal : AutoLens

Protocol for automatic derivation of Traversal

  • traversal(for:) Extension method

    Provides a Traversal focused on the items of the field given by a key path.

    Declaration

    Swift

    static func traversal<T>(for path: WritableKeyPath<Self, Array<T>>) -> Traversal<Self, T>

    Parameters

    path

    Key path to a field containing an array of items.

    Return Value

    A Traversal focused on the items of the field.

  • traversal(for:) Extension method

    Provides a Traversal focused on the items of the field given by a key path.

    Declaration

    Swift

    static func traversal<T>(for path: WritableKeyPath<Self, ArrayK<T>>) -> Traversal<Self, T>

    Parameters

    path

    Key path to a field containing an ArrayK of items.

    Return Value

    A Traversal focused on the items of the field.

  • traversal(for:) Extension method

    Provides a Traversal focused on the items of the field given by a key path.

    Declaration

    Swift

    static func traversal<T, F>(for path: WritableKeyPath<Self, Kind<F, T>>) -> Traversal<Self, T> where F : Traverse

    Parameters

    path

    Key path to a field of a type with an instance of Traverse.

    Return Value

    A Traversal focused on the items of the Traverse structure.