Skip to main content

LocalExecutor

Trait LocalExecutor 

Source
pub trait LocalExecutor {
    type Plan;
    type Receipt;
    type Error: ClassifiedExecutionError;

    // Required methods
    fn state(&self) -> ExecutorState;
    fn warm(
        &mut self,
        plan: &Self::Plan,
        cancellation: &dyn CancellationProbe,
    ) -> Result<Self::Receipt, Self::Error>;
    fn execute(
        &mut self,
        plan: &Self::Plan,
        inputs: &[InputBuffer<'_>],
        outputs: &mut [OutputBuffer<'_>],
        cancellation: &dyn CancellationProbe,
    ) -> Result<Self::Receipt, Self::Error>;
    fn clear_session(&mut self) -> Result<CleanupReceipt, Self::Error>;
    fn close(self) -> Result<CleanupReceipt, Self::Error>
       where Self: Sized;
}
Expand description

Synchronous, single-owner executor over borrowed storage.

Implementations must not retain input or output slices after a call. Transport, admission, queueing, and resource allocation remain outside this trait.

Required Associated Types§

Source

type Plan

Exact backend-specific plan.

Source

type Receipt

Successful mechanical receipt.

Source

type Error: ClassifiedExecutionError

Classified executor failure.

Required Methods§

Source

fn state(&self) -> ExecutorState

Returns current lifecycle state.

Source

fn warm( &mut self, plan: &Self::Plan, cancellation: &dyn CancellationProbe, ) -> Result<Self::Receipt, Self::Error>

Performs an explicit caller-selected warm operation.

§Errors

Returns a classified request, cancellation, native, or cleanup error.

Source

fn execute( &mut self, plan: &Self::Plan, inputs: &[InputBuffer<'_>], outputs: &mut [OutputBuffer<'_>], cancellation: &dyn CancellationProbe, ) -> Result<Self::Receipt, Self::Error>

Executes over already verified borrowed inputs and caller-owned outputs.

§Errors

Returns a classified request, cancellation, native, or cleanup error.

Source

fn clear_session(&mut self) -> Result<CleanupReceipt, Self::Error>

Clears request-local mutable state and advances the backend epoch.

§Errors

Returns a poisoning error when cleanup cannot be confirmed.

Source

fn close(self) -> Result<CleanupReceipt, Self::Error>
where Self: Sized,

Consumes the executor and explicitly releases resident state.

§Errors

Returns a poisoning error when cleanup cannot be confirmed.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§