pub struct OnceQueue<T: Identify> { /* private fields */ }Implementations§
Source§impl<T: Identify> OnceQueue<T>
impl<T: Identify> OnceQueue<T>
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> Iter<'_, T>
pub fn is_pushable(&self, value: &T) -> bool
pub fn count(&self, value: &T) -> u32
Sourcepub fn push_back(&mut self, value: T) -> Result<(), T>
pub fn push_back(&mut self, value: T) -> Result<(), T>
Appends the value at the end of the queue if the queue has not seen the value before.
If the queue has seen the value, then returns it within error.
Sourcepub fn push_front(&mut self, value: T) -> Result<(), T>
pub fn push_front(&mut self, value: T) -> Result<(), T>
Appends the value at the beginning of the queue if the queue has not seen the value before.
If the queue has seen the value, then returns it within error.
Sourcepub fn push_back_force(&mut self, value: T)
pub fn push_back_force(&mut self, value: T)
Appends the value at the end of the queue regardless of whether the queue has seen the value before.
Sourcepub fn push_front_force(&mut self, value: T)
pub fn push_front_force(&mut self, value: T)
Appends the value at the beginning of the queue regardless of whether the queue has seen the value before.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for OnceQueue<T>
impl<T> RefUnwindSafe for OnceQueue<T>
impl<T> Send for OnceQueue<T>
impl<T> Sync for OnceQueue<T>
impl<T> Unpin for OnceQueue<T>
impl<T> UnsafeUnpin for OnceQueue<T>
impl<T> UnwindSafe for OnceQueue<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> 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