Skip to main content

CircularQueue

Struct CircularQueue 

Source
pub struct CircularQueue<T> { /* private fields */ }

Implementations§

Source§

impl<T> CircularQueue<T>

Source

pub fn new(capacity: usize) -> Result<Self, QueueError>

Trait Implementations§

Source§

impl<T> CircularQueueLike<T> for CircularQueue<T>

Source§

type Error = QueueError

Source§

fn capacity(&self) -> usize

Source§

fn at(&self, index: isize) -> Option<&T>

Source§

fn resize(&mut self, new_capacity: usize) -> Result<(), Self::Error>

Source§

fn rearrange(&mut self)

Source§

impl<T> Collection for CircularQueue<T>

Source§

type Item = T

Source§

type Iter<'a> = Iter<'a, T> where Self: 'a

Source§

fn iter(&self) -> Self::Iter<'_>

Source§

fn size(&self) -> usize

Source§

fn clear(&mut self)

Source§

fn retain<F>(&mut self, f: F) -> usize
where F: FnMut(&Self::Item) -> bool,

Source§

fn count<F>(&self, filter: F) -> usize
where F: FnMut(&Self::Item) -> bool,

Source§

fn collect_into<C>(&self, out: &mut C)
where C: Extend<Self::Item>, Self::Item: Clone,

Source§

fn collect(&self) -> Vec<Self::Item>
where Self::Item: Clone,

Source§

fn is_empty(&self) -> bool

Source§

impl<T: Debug> Debug for CircularQueue<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> DequeLike<T> for CircularQueue<T>

Source§

fn back(&self) -> Option<&T>

Source§

fn enqueue_front(&mut self, element: T)

Source§

fn dequeue_back(&mut self) -> Option<T>

Source§

fn enqueues_front<I>(&mut self, elements: I)
where I: IntoIterator<Item = T>,

Source§

fn replace_back(&mut self, new_front: T) -> Option<T>

Source§

impl<T> Disposable for CircularQueue<T>

Source§

fn dispose(&mut self)

Source§

fn is_disposed(&self) -> bool

Source§

impl<'a, T> IntoIterator for &'a CircularQueue<T>

Source§

type Item = &'a T

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<T> QueueLike<T> for CircularQueue<T>

Source§

fn front(&self) -> Option<&T>

Source§

fn enqueue(&mut self, element: T)

Source§

fn dequeue(&mut self) -> Option<T>

Source§

fn enqueues<I>(&mut self, elements: I)
where I: IntoIterator<Item = T>,

Source§

fn replace_front(&mut self, new_back: T) -> Option<T>

Auto Trait Implementations§

§

impl<T> Freeze for CircularQueue<T>

§

impl<T> RefUnwindSafe for CircularQueue<T>
where T: RefUnwindSafe,

§

impl<T> Send for CircularQueue<T>
where T: Send,

§

impl<T> Sync for CircularQueue<T>
where T: Sync,

§

impl<T> Unpin for CircularQueue<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for CircularQueue<T>

§

impl<T> UnwindSafe for CircularQueue<T>
where T: UnwindSafe,

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<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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.