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 wake_one(source: Proof<(&Self, usize), Physical>) -> Once

Wakes one entry in the lane retained by this exact queue’s physical proof.

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_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 wake_one(&self, index: Index<'scope>) -> Once

Source§

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

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 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> Forget for Queue<'d, L>

§

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

§

impl<'d, L> Unpin for Queue<'d, L>
where L: Unpin, Root<'d, Shared<Context<Receive>>>: Unpin, *mut (): Unpin, *const Node<Entry<Retained<'d>>> is !null: Unpin, *const Node<Chain> is !null: Unpin, NonZero<u32>: Unpin,

§

impl<'d, L> UnsafeUnpin for Queue<'d, L>
where Root<'d, Shared<Context<Receive>>>: UnsafeUnpin, PhantomData<(fn(&'d ()) -> &'d (), ThreadBound)>: UnsafeUnpin, *const Node<Entry<Retained<'d>>> is !null: UnsafeUnpin, *const Node<Chain> is !null: UnsafeUnpin, NonZeroU32Inner: UnsafeUnpin, PhantomData<(Node<Entry<Retained<'d>>>, Node<Chain>, L, ())>: UnsafeUnpin, PhantomData<(ThreadBound, !)>: 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<L, R> Convert<Either<L, R>, 1> for L

Source§

fn into(self) -> Either<L, R>

Source§

unsafe fn take_into(source: *mut Self, place: &mut MaybeUninit<T>)
where Self: Sized,

Safety Read more
Source§

impl<L, R> Convert<Either<L, R>, 2> for R

Source§

fn into(self) -> Either<L, R>

Source§

unsafe fn take_into(source: *mut Self, place: &mut MaybeUninit<T>)
where Self: Sized,

Safety Read more
Source§

impl<T> Convert<T> for T

Source§

fn into(self) -> T

Source§

unsafe fn take_into(source: *mut Self, place: &mut MaybeUninit<T>)
where Self: Sized,

Safety 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.