Skip to main content

SimQueue

Struct SimQueue 

Source
pub struct SimQueue { /* private fields */ }
Expand description

A simulated per-thread queue.

Trait Implementations§

Source§

impl Queue for SimQueue

Source§

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 File = SimFile

The platform’s file handle type.
Source§

type Waker = SimWaker

The queue’s waker (Self::waker).
Source§

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>

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 more
Source§

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>

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 more
Source§

fn in_flight(&self) -> usize

Operations submitted and not yet reaped.
Source§

fn waker(&self) -> SimWaker

A handle another thread uses to end this queue’s wait (D-083).
Source§

fn workers(&self) -> Option<usize>

Worker threads that run this queue’s operations concurrently, when the backend runs them on a pool (QueueConfig::parallel); None when they run inside submit or in the kernel.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.