Skip to main content

Operation

Trait Operation 

Source
pub trait Operation {
    // Required methods
    fn setup(self, info: OperationSetup<'_>) -> OperationResult;
    fn execute(request: OperationRequest<'_>) -> OperationResult;
    fn cleanup(clean: OperationCleanup<'_>) -> OperationResult;
    fn is_reachable(
        reachability: OperationReachability<'_>,
    ) -> ReachabilityResult;
}
Expand description

Trait that defines a single operation within a chain.

Required Methods§

Source

fn setup(self, info: OperationSetup<'_>) -> OperationResult

Set the initial parameters for your operation. This gets called while the chain is being built.

Source

fn execute(request: OperationRequest<'_>) -> OperationResult

Execute this operation. This gets triggered when a new InputStorage component is added to source or when another operation puts source into the OperationRoster::queue.

Source

fn cleanup(clean: OperationCleanup<'_>) -> OperationResult

A request has reached its termination, so this operation needs to clean up any residual data for it.

Source

fn is_reachable(reachability: OperationReachability<'_>) -> ReachabilityResult

Return whether this operation can be reached. Being reachable means there is some sequence of operations that could lead to this one being triggered for a given session, or this operation is currently active for the given session.

This is primarily used to determine if a Join has stalled out or if a request will never be able to terminate.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§