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§
Sourcefn setup(self, info: OperationSetup<'_>) -> OperationResult
fn setup(self, info: OperationSetup<'_>) -> OperationResult
Set the initial parameters for your operation. This gets called while the chain is being built.
Sourcefn execute(request: OperationRequest<'_>) -> OperationResult
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.
Sourcefn cleanup(clean: OperationCleanup<'_>) -> OperationResult
fn cleanup(clean: OperationCleanup<'_>) -> OperationResult
A request has reached its termination, so this operation needs to clean up any residual data for it.
Sourcefn is_reachable(reachability: OperationReachability<'_>) -> ReachabilityResult
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".