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§
Sourcefn submit(&self, owner: IoOwnerId, batch: IoBatch) -> VortexResult<()>
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.
Sourcefn poll(&self) -> VortexResult<Option<Completion>>
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.
Sourcefn poll_completion(
&self,
cx: &mut Context<'_>,
) -> Poll<VortexResult<Completion>>
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.
Sourcefn wait(&self) -> VortexResult<Completion>
fn wait(&self) -> VortexResult<Completion>
Blocks until a required completion is available or a read fails.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".