pub struct PinnedDeque<T: Sized> { /* private fields */ }Implementations§
Source§impl<T> PinnedDeque<T>where
T: Sized,
impl<T> PinnedDeque<T>where
T: Sized,
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates an empty deque with the adaptive capacity per chunk.
Caveat: The default capacity per chunk intends to fit a chunk into a memory page. So, if the size of a single element plus the chunk overhead (8B) exceeds the size of a memory page, do not use this constructor.
Sourcepub fn with_capacity_per_chunk(cap_per_chunk: u32) -> Self
pub fn with_capacity_per_chunk(cap_per_chunk: u32) -> Self
Creates an empty deque with the given capacity per chunk.
Sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserves additional capacity in order to avoid memory allocations then.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Returns the total capacity of the deque.
This deque do not guarantee that pushing elements will not cause memory allocations
even if there is enough free capacity (i.e., capacity() - len()).
pub fn push_back(&mut self, elem: T)
pub fn push_front(&mut self, elem: T)
pub fn pop_back(&mut self) -> Option<T>
pub fn pop_front(&mut self) -> Option<T>
pub fn back(&self) -> Option<&T>
pub fn front(&self) -> Option<&T>
pub fn back_mut(&mut self) -> Option<&mut T>
pub fn front_mut(&mut self) -> Option<&mut T>
pub fn clear(&mut self)
pub fn get(&self, idx: usize) -> Option<&T>
pub fn get_mut(&mut self, idx: usize) -> Option<&mut T>
pub fn iter(&self) -> Iter<'_, T> ⓘ
pub fn iter_mut(&mut self) -> IterMut<'_, T> ⓘ
Trait Implementations§
Source§impl<T> Clone for PinnedDeque<T>
impl<T> Clone for PinnedDeque<T>
Source§impl<T> Debug for PinnedDeque<T>
impl<T> Debug for PinnedDeque<T>
Source§impl<T> Default for PinnedDeque<T>where
T: Sized,
impl<T> Default for PinnedDeque<T>where
T: Sized,
Source§impl<T> Drop for PinnedDeque<T>where
T: Sized,
impl<T> Drop for PinnedDeque<T>where
T: Sized,
Source§impl<T> Extend<T> for PinnedDeque<T>where
T: Sized,
impl<T> Extend<T> for PinnedDeque<T>where
T: Sized,
Source§fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<T> FromIterator<T> for PinnedDeque<T>where
T: Sized,
impl<T> FromIterator<T> for PinnedDeque<T>where
T: Sized,
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl<'a, T: Sized> IntoIterator for &'a PinnedDeque<T>
impl<'a, T: Sized> IntoIterator for &'a PinnedDeque<T>
Source§impl<'a, T: Sized> IntoIterator for &'a mut PinnedDeque<T>
impl<'a, T: Sized> IntoIterator for &'a mut PinnedDeque<T>
Source§impl<T: Sized> IntoIterator for PinnedDeque<T>
impl<T: Sized> IntoIterator for PinnedDeque<T>
Source§impl<T> Ord for PinnedDeque<T>
impl<T> Ord for PinnedDeque<T>
Source§impl<T> PartialEq for PinnedDeque<T>
impl<T> PartialEq for PinnedDeque<T>
Source§impl<T> PartialOrd for PinnedDeque<T>where
T: Sized + PartialOrd,
impl<T> PartialOrd for PinnedDeque<T>where
T: Sized + PartialOrd,
impl<T> Eq for PinnedDeque<T>
Auto Trait Implementations§
impl<T> Freeze for PinnedDeque<T>
impl<T> RefUnwindSafe for PinnedDeque<T>where
T: RefUnwindSafe,
impl<T> !Send for PinnedDeque<T>
impl<T> !Sync for PinnedDeque<T>
impl<T> Unpin for PinnedDeque<T>
impl<T> UnwindSafe for PinnedDeque<T>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