Skip to main content

Queue

Struct Queue 

Source
pub struct Queue<'d, L = NonZero<usize>> { /* private fields */ }
Expand description

Bounded FIFO wakes with a constructor-proved lane extent.

Implementations§

Source§

impl<'d, L> Queue<'d, L>

Source

pub fn try_new( driver: Reference<'d>, capacity: usize, lanes: L, ) -> Result<Self, Error>
where L: Extent,

Source§

impl<'d> Queue<'d>

Source

pub fn try_with<S, R>( driver: Reference<'d>, capacity: usize, lanes: NonZero<usize>, source: S, run: impl for<'scope> FnOnce(&'scope S, Queue<'d, Scope<'scope>>) -> R, ) -> Result<R, Error>

Creates one queue and borrows its source under a fresh invariant scope.

Source

pub fn try_register<'target>( &'target self, position: usize, slot: &mut Registration<'target, 'd>, wake: &Waker<'d>, ) -> Result<(), Error>

Source

pub fn try_wake_one( &self, position: usize, ) -> Result<Once, Bounds<NonZero<u32>>>

Source§

impl<'scope, 'd> Queue<'d, Scope<'scope>>

Source

pub fn try_index( &self, position: usize, ) -> Result<Index<'scope>, Bounds<NonZero<u32>>>

Source

pub fn try_register<'target>( &'target self, index: Index<'scope>, slot: &mut Registration<'target, 'd, Scope<'scope>>, wake: &Waker<'d>, ) -> Result<(), Reject>

Source

pub fn wake_one(&self, index: Index<'scope>) -> Once

Source§

impl<'d, const N: usize> Queue<'d, Fixed<N>>

Source

pub fn try_register<'target, const I: usize>( &'target self, slot: &mut Registration<'target, 'd, Fixed<N>>, wake: &Waker<'d>, ) -> Result<(), Reject>

Source

pub fn wake_one<const I: usize>(&self) -> Once

Source§

impl<'d, L> Queue<'d, L>

Source

pub fn cancel(&self, slot: &mut Registration<'_, 'd, L>) -> Once

Cancels the registration, forwarding a taken wake within its original lane. Active drains retain their work; successful admission uses clear.

Source

pub fn try_first<'target>( &'target self, slot: &mut Registration<'target, 'd, L>, wake: &Waker<'d>, ) -> Result<(), Reject>

Registers one wake in the constructor-proved first lane.

Source

pub fn wake_first(&self) -> Once

Wakes one registration from lane zero.

Source

pub fn wake_next(&self) -> Once

Source

pub fn has_waiters(&self) -> bool

Source

pub fn begin_drain(&self)

Source

pub fn is_draining(&self) -> bool

Source

pub fn drain_one(&self, work: Work<'_, 'd>) -> Drain

Auto Trait Implementations§

§

impl<'d, L = NonZero<usize>> !Freeze for Queue<'d, L>

§

impl<'d, L = NonZero<usize>> !RefUnwindSafe for Queue<'d, L>

§

impl<'d, L = NonZero<usize>> !Send for Queue<'d, L>

§

impl<'d, L = NonZero<usize>> !Sync for Queue<'d, L>

§

impl<'d, L = NonZero<usize>> !UnwindSafe for Queue<'d, L>

§

impl<'d, L> Unpin for Queue<'d, L>
where Fifo<Retained<'d>, L>: Unpin,

§

impl<'d, L> UnsafeUnpin for Queue<'d, L>
where Fifo<Retained<'d>, L>: UnsafeUnpin,

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> Convert<T> for T

Source§

fn into(self) -> T

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.