AutoAffineTraversal

public protocol AutoAffineTraversal : AutoOptics

Protocol for automatic derivation of AffineTraversal optics.

  • affineTraversal(for:) Extension method

    Generates an AffineTraversal optic that focuses on a nilable field.

    Declaration

    Swift

    static func affineTraversal<T>(for path: WritableKeyPath<Self, T?>) -> AffineTraversal<Self, T>

    Parameters

    path

    Key path to a nilable field.

    Return Value

    An AffineTraversal optic focusing on the provided field.

  • affineTraversal(for:) Extension method

    Generates an AffineTraversal optic that focuses on an Option field.

    Declaration

    Swift

    static func affineTraversal<T>(for path: WritableKeyPath<Self, Option<T>>) -> AffineTraversal<Self, T>

    Parameters

    path

    Key path to an Option field.

    Return Value

    An AffineTraversal optic focusing on the provided field.