Skip to main content

IoSource

Trait IoSource 

Source
pub trait IoSource: Send + Sync {
    // Required methods
    fn submit(&self, owner: IoOwnerId, batch: IoBatch) -> VortexResult<()>;
    fn poll(&self) -> VortexResult<Option<Completion>>;
    fn poll_completion(
        &self,
        cx: &mut Context<'_>,
    ) -> Poll<VortexResult<Completion>>;
    fn wait(&self) -> VortexResult<Completion>;
    fn release(&self, owner: IoOwnerId);
    fn clear(&self);
}
Expand description

IO registration and dispatch for one registration scope, such as the work descended from one root planner. Services may decline optional hints. Accepted optional work belongs to the source, not to the publishing stage, and lives until the source is cleared or dropped.

Required Methods§

Source

fn submit(&self, owner: IoOwnerId, batch: IoBatch) -> VortexResult<()>

Registers a whole batch before any of its reads become eligible for dispatch. Registration does not perform IO and never blocks.

Source

fn poll(&self) -> VortexResult<Option<Completion>>

Advances eligible IO without blocking and returns a required completion if ready. Optional successes stay in the source; any read failure fails the run.

Source

fn poll_completion( &self, cx: &mut Context<'_>, ) -> Poll<VortexResult<Completion>>

Like poll, registering cx to be woken when a required completion is ready. Fails when no fetch is in flight, since nothing would ever wake the caller.

Source

fn wait(&self) -> VortexResult<Completion>

Blocks until a required completion is available or a read fails.

Source

fn release(&self, owner: IoOwnerId)

Releases a retired object’s fetch subscriptions, preserving optional announcements.

Source

fn clear(&self)

Cancels the scope’s registrations and drops retained bytes and pending completions.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§