pub struct LockFreeQueueU32<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> LockFreeQueueU32<T, N>
impl<T, const N: usize> LockFreeQueueU32<T, N>
Sourcepub unsafe fn try_pull_id(&self, id: u32) -> Option<T>
pub unsafe fn try_pull_id(&self, id: u32) -> Option<T>
Try to pull an item from the queue after a consume.
§Safety
- The
idneed to be take from the consume method, otherwise the queue may block.
Sourcepub unsafe fn try_consume(&self) -> Result<Option<u32>, QueueError<T>>
pub unsafe fn try_consume(&self) -> Result<Option<u32>, QueueError<T>>
Try to consume an item from the queue
§Safety
- Only one thread can consume from the queue otherwise the queue may block.
Sourcepub unsafe fn consume(&self) -> Result<u32, QueueError<T>>
pub unsafe fn consume(&self) -> Result<u32, QueueError<T>>
Consume an item from the queue
§Safety
- Only one thread can consume from the queue otherwise the queue may block.
Sourcepub fn push(&self, val: T) -> Result<(), QueueError<T>>
pub fn push(&self, val: T) -> Result<(), QueueError<T>>
Push an item in the queue. Return an error if it can’t
Sourcepub unsafe fn try_pull(&self) -> Result<Option<T>, QueueError<T>>
pub unsafe fn try_pull(&self) -> Result<Option<T>, QueueError<T>>
Try to pull an item from the queue.
For a single consumer, it return a Full error if the queue was full to notify that item can be push again in the queue.
§Safety
- Only one thread can pull from the queue otherwise the queue may block.
Sourcepub unsafe fn pull(&self) -> Result<T, QueueError<T>>
pub unsafe fn pull(&self) -> Result<T, QueueError<T>>
Pull an item from the queue.
For a single consumer, it return a Full error if the queue was full to notify that item can be push again in the queue.
§Safety
- Only one thread can pull from the queue otherwise the queue may block.
Trait Implementations§
Source§impl<T, const N: usize> Debug for LockFreeQueueU32<T, N>
impl<T, const N: usize> Debug for LockFreeQueueU32<T, N>
Source§impl<T, const N: usize> Default for LockFreeQueueU32<T, N>
impl<T, const N: usize> Default for LockFreeQueueU32<T, N>
Source§impl<T, const N: usize> Drop for LockFreeQueueU32<T, N>
impl<T, const N: usize> Drop for LockFreeQueueU32<T, N>
Source§impl<T, const N: usize> QueueChecker<u32> for LockFreeQueueU32<T, N>
impl<T, const N: usize> QueueChecker<u32> for LockFreeQueueU32<T, N>
Auto Trait Implementations§
impl<T, const N: usize> !Freeze for LockFreeQueueU32<T, N>
impl<T, const N: usize> RefUnwindSafe for LockFreeQueueU32<T, N>
impl<T, const N: usize> Send for LockFreeQueueU32<T, N>
impl<T, const N: usize> Sync for LockFreeQueueU32<T, N>
impl<T, const N: usize> Unpin for LockFreeQueueU32<T, N>
impl<T, const N: usize> UnwindSafe for LockFreeQueueU32<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