pub struct SimQueue { /* private fields */ }Expand description
A simulated per-thread queue.
Trait Implementations§
Source§impl Queue for SimQueue
impl Queue for SimQueue
Source§fn performs(&self) -> bool
fn performs(&self) -> bool
With crate::SimConfig::inline and nothing in flight: the checks
submit makes, then the completion at once (its faults as any
completion’s), as an inline queue performs inside submit.
Source§type Waker = SimWaker
type Waker = SimWaker
The queue’s waker (
Self::waker).Source§fn submit(&mut self, op: IoOp<'_, SimFile>, tag: u64) -> Result<(), Rejected>
fn submit(&mut self, op: IoOp<'_, SimFile>, tag: u64) -> Result<(), Rejected>
Submits an operation tagged with a caller value. Read more
Source§fn perform<'a>(
&mut self,
op: IoOp<'a, SimFile>,
) -> Result<Result<(Option<IoBuf>, RawResult<usize>), IoOp<'a, SimFile>>, Rejected>
fn perform<'a>( &mut self, op: IoOp<'a, SimFile>, ) -> Result<Result<(Option<IoBuf>, RawResult<usize>), IoOp<'a, SimFile>>, Rejected>
Performs
op now, on the calling thread, when Self::performs:
its buffer and result, exactly as its completion would carry them
(the same checks first, the same faults), with no completion left
behind. Otherwise the operation comes back (Ok(Err(op))) for
Self::submit. The default never performs. Read moreSource§fn reap(&mut self, out: &mut CompletionBuf) -> usize
fn reap(&mut self, out: &mut CompletionBuf) -> usize
Moves finished completions into
out without blocking; returns how
many were added.Source§fn wait(&mut self, min: usize, out: &mut CompletionBuf) -> RawResult<usize>
fn wait(&mut self, min: usize, out: &mut CompletionBuf) -> RawResult<usize>
Blocks until at least
min completions have been added to out, or
out is full, or nothing is left in flight, or the queue’s waker
fired (Self::waker; the wait may then have added nothing); returns
how many were added. Never times out, and never waits for more than
is in flight. Read moreAuto Trait Implementations§
impl Forget for SimQueue
impl Freeze for SimQueue
impl Move for SimQueue
impl RefUnwindSafe for SimQueue
impl Send for SimQueue
impl Sync for SimQueue
impl Unpin for SimQueue
impl UnsafeUnpin for SimQueue
impl UnwindSafe for SimQueue
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