pub struct ConcurrentQueue<T> { /* private fields */ }Expand description
Thread-safe queue using VecDeque
Implementations§
Source§impl<T: Clone> ConcurrentQueue<T>
impl<T: Clone> ConcurrentQueue<T>
Sourcepub fn push_back(&self, item: T) -> UtilsResult<()>
pub fn push_back(&self, item: T) -> UtilsResult<()>
Push an element to the back of the queue
Sourcepub fn push_front(&self, item: T) -> UtilsResult<()>
pub fn push_front(&self, item: T) -> UtilsResult<()>
Push an element to the front of the queue
Sourcepub fn pop_front(&self) -> UtilsResult<Option<T>>
pub fn pop_front(&self) -> UtilsResult<Option<T>>
Pop an element from the front of the queue
Sourcepub fn pop_back(&self) -> UtilsResult<Option<T>>
pub fn pop_back(&self) -> UtilsResult<Option<T>>
Pop an element from the back of the queue
Sourcepub fn len(&self) -> UtilsResult<usize>
pub fn len(&self) -> UtilsResult<usize>
Get the current size of the queue
Sourcepub fn is_empty(&self) -> UtilsResult<bool>
pub fn is_empty(&self) -> UtilsResult<bool>
Check if the queue is empty
Trait Implementations§
Source§impl<T: Clone> Clone for ConcurrentQueue<T>
impl<T: Clone> Clone for ConcurrentQueue<T>
Source§fn clone(&self) -> ConcurrentQueue<T>
fn clone(&self) -> ConcurrentQueue<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for ConcurrentQueue<T>
impl<T: Debug> Debug for ConcurrentQueue<T>
Auto Trait Implementations§
impl<T> Freeze for ConcurrentQueue<T>
impl<T> RefUnwindSafe for ConcurrentQueue<T>
impl<T> Send for ConcurrentQueue<T>where
T: Send,
impl<T> Sync for ConcurrentQueue<T>where
T: Send,
impl<T> Unpin for ConcurrentQueue<T>
impl<T> UnwindSafe for ConcurrentQueue<T>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more