pub struct BoundedDeque<T> { /* private fields */ }Implementations§
Source§impl<T> BoundedDeque<T>
impl<T> BoundedDeque<T>
Sourcepub fn set_maxlen(&mut self, new_maxlen: usize)
pub fn set_maxlen(&mut self, new_maxlen: usize)
Sets a new maximum length for the deque. If the new maxlen is smaller than the current length, elements are removed from the start until the length is within the new limit.
Sourcepub fn get_maxlen(&self) -> usize
pub fn get_maxlen(&self) -> usize
Returns the current maximum length of the deque.
Sourcepub fn push_back(&mut self, item: T)
pub fn push_back(&mut self, item: T)
Adds an item to the end. If the deque is at capacity, removes from the start first.
Sourcepub fn push_front(&mut self, item: T)
pub fn push_front(&mut self, item: T)
Adds an item to the start. If the deque is at capacity, removes from the end first.
Trait Implementations§
Source§impl<T: Clone> Clone for BoundedDeque<T>
impl<T: Clone> Clone for BoundedDeque<T>
Source§fn clone(&self) -> BoundedDeque<T>
fn clone(&self) -> BoundedDeque<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for BoundedDeque<T>
impl<T> RefUnwindSafe for BoundedDeque<T>where
T: RefUnwindSafe,
impl<T> Send for BoundedDeque<T>where
T: Send,
impl<T> Sync for BoundedDeque<T>where
T: Sync,
impl<T> Unpin for BoundedDeque<T>where
T: Unpin,
impl<T> UnsafeUnpin for BoundedDeque<T>
impl<T> UnwindSafe for BoundedDeque<T>where
T: UnwindSafe,
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