ActionConfiguring

@MainActor
public protocol ActionConfiguring<InteractorType, ContentType>

This protocol represents an object that can be used to configure an Action for use in an ActionPerformableCollection object.

  • Undocumented

    Declaration

    Swift

    associatedtype InteractorType : InteractorTypeable
  • Undocumented

    Declaration

    Swift

    associatedtype ActionType : InteractorRequestActionTypeable
  • Undocumented

    Declaration

    Swift

    associatedtype ContentType : ContentTypeable
  • interactorType Default implementation

    The interactor type associated with this configuration, if any.

    Default Implementation

    Declaration

    Swift

    @MainActor
    var interactorType: InteractorType? { get }
  • The type of Interactor action type.

    Declaration

    Swift

    @MainActor
    var actionType: ActionType { get }
  • The type of Interactor assistant.

    Declaration

    Swift

    @MainActor
    var assistant: InteractorAssistantType { get }
  • The output conduit to be used to pass this action’s output to the next action.

    Declaration

    Swift

    @MainActor
    var outputConduit: (any ActionSequenceConduiting<ContentType>)? { get set }
  • identifier Default implementation

    An optional type tagging this step, carried onto its ActionResponse so the response can be located in an ActionSequenceResponses object. Defaults to nil.

    Default Implementation

    Declaration

    Swift

    @MainActor
    var identifier: (any ActionIdentifying)? { get }
  • Determines whether on failure the action should cancel its parent task.

    Declaration

    Swift

    @MainActor
    var shouldEndParentTaskOnFailure: Bool { get }
  • Determines whether the result of this action should be saved and returned in the collection’s ActionCollectionResults object. This won’t prevent the result from being passed through its outputConduit to the next action. Setting this property to false can be helpful in cases where you don’t want to retain content that takes up a large amount of memory, such as an image retrieved from a server.

    Declaration

    Swift

    @MainActor
    var shouldSaveResult: Bool { get }
  • Builds the interactor assistant this configuration’s step will use to make its request. Building the assistant here allows access to the concrete Interactor type, which is erased at the sequence level.

    This is used both to build a standalone Action and to build the child assistants of an ActionGroup.

    Declaration

    Swift

    @MainActor
    func buildAssistant() throws -> any AsyncInteractorAssisting<InteractorType, ContentType>

    Return Value

    An async interactor assistant for this configuration’s action.

  • Builds a runnable sequence step from this configuration, also constructing the Interactor assistant the step will use to make its request. Building the assistant here allows access to the concrete Interactor type, which is erased at the sequence level.

    Declaration

    Swift

    @MainActor
    func buildAction(resultHandler: any InteractorResultHandling<InteractorType, ContentType>) throws -> any ActionPerformable<ContentType>

    Parameters

    resultHandler

    The object which should handle the results of the step’s interactor request.

    Return Value

    A Result containing the step, or a failure if the configured assistant is incompatible with this configuration’s types.