pub struct Ring<F: BackendFactory> { /* private fields */ }Expand description
Submission and completion router.
Implementations§
Source§impl<F: BackendFactory> Ring<F>
impl<F: BackendFactory> Ring<F>
Sourcepub fn new(config: RingConfig) -> Result<Self>
pub fn new(config: RingConfig) -> Result<Self>
Creates a ring using the selected backend policy.
Sourcepub fn backend_kind(&self) -> BackendKind
pub fn backend_kind(&self) -> BackendKind
Returns the active backend kind.
Sourcepub fn queue_depth(&self) -> u32
pub fn queue_depth(&self) -> u32
Returns the configured queue depth.
Sourcepub fn batch<I, O>(&self, ops: I) -> Result<Vec<O::Output>>where
I: IntoIterator<Item = O>,
O: Op,
pub fn batch<I, O>(&self, ops: I) -> Result<Vec<O::Output>>where
I: IntoIterator<Item = O>,
O: Op,
Submits a batch of operations and returns ordered results.
The ring keeps at most queue_depth requests in flight at once, so
callers can batch arbitrarily large iterators without manually chunking.
Sourcepub fn chain<T>(
&self,
run: impl FnOnce(ChainContext<'_, F>) -> Result<T>,
) -> Result<T>
pub fn chain<T>( &self, run: impl FnOnce(ChainContext<'_, F>) -> Result<T>, ) -> Result<T>
Runs a dependent chain of operations in one call.
This is the high-level API for flows where later operations require
outputs from earlier ones, such as connect -> send -> recv.
Sourcepub fn submit<O: Op>(&self, op: O) -> Result<Request<O::Output>>
pub fn submit<O: Op>(&self, op: O) -> Result<Request<O::Output>>
Submits an operation and returns a typed request handle.
Trait Implementations§
Source§impl<F: BackendFactory> Drop for Ring<F>
impl<F: BackendFactory> Drop for Ring<F>
Auto Trait Implementations§
impl<F> !RefUnwindSafe for Ring<F>
impl<F> !UnwindSafe for Ring<F>
impl<F> Freeze for Ring<F>
impl<F> Send for Ring<F>
impl<F> Sync for Ring<F>
impl<F> Unpin for Ring<F>where
F: Unpin,
impl<F> UnsafeUnpin for Ring<F>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more