pub struct LockFreeOptQueueU16<T, const N: usize> { /* private fields */ }Available on crate feature
queue only.Expand description
Implementation of an Atomic queue
Implementations§
Source§impl<T, const N: usize> LockFreeOptQueueU16<T, N>
impl<T, const N: usize> LockFreeOptQueueU16<T, N>
Sourcepub fn try_pull_id(&self, id: u16) -> Option<T>
pub fn try_pull_id(&self, id: u16) -> Option<T>
Try to pull an item from the queue. The item need to be in the queue otherwise it will not try.
Sourcepub unsafe fn push(&self, val: T) -> Result<(u16, u16), QueueError<T>>
pub unsafe fn push(&self, val: T) -> Result<(u16, u16), QueueError<T>>
Push an item in the queue. Return the id of the element in the queue, or an error if it can’t push the item
§Safety
- Only one thread can push into the queue otherwise the queue may block.
Sourcepub fn try_pull(&self) -> Result<Option<T>, QueueError<T>>
pub fn try_pull(&self) -> Result<Option<T>, QueueError<T>>
Try to pull an item from the queue.
Sourcepub fn pull(&self) -> Result<T, QueueError<T>>
pub fn pull(&self) -> Result<T, QueueError<T>>
Pull an item from the queue.
Trait Implementations§
Source§impl<T, const N: usize> Debug for LockFreeOptQueueU16<T, N>
impl<T, const N: usize> Debug for LockFreeOptQueueU16<T, N>
Source§impl<T, const N: usize> Default for LockFreeOptQueueU16<T, N>
impl<T, const N: usize> Default for LockFreeOptQueueU16<T, N>
Source§impl<T, const N: usize> Drop for LockFreeOptQueueU16<T, N>
impl<T, const N: usize> Drop for LockFreeOptQueueU16<T, N>
Source§impl<T, const N: usize> QueueChecker<u16> for LockFreeOptQueueU16<T, N>
impl<T, const N: usize> QueueChecker<u16> for LockFreeOptQueueU16<T, N>
Auto Trait Implementations§
impl<T, const N: usize> !Freeze for LockFreeOptQueueU16<T, N>
impl<T, const N: usize> RefUnwindSafe for LockFreeOptQueueU16<T, N>
impl<T, const N: usize> Send for LockFreeOptQueueU16<T, N>
impl<T, const N: usize> Sync for LockFreeOptQueueU16<T, N>
impl<T, const N: usize> Unpin for LockFreeOptQueueU16<T, N>
impl<T, const N: usize> UnwindSafe for LockFreeOptQueueU16<T, N>where
T: RefUnwindSafe,
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request