Struct generational_lru::list::LinkedList
source · [−]pub struct LinkedList<T> {
arena: Arena<Node<T>>,
head: Option<Link>,
tail: Option<Link>,
len: usize,
}
Expand description
A generational arena based doubly linked list implementation.
Fields
arena: Arena<Node<T>>
head: Option<Link>
tail: Option<Link>
len: usize
Implementations
sourceimpl<T> LinkedList<T>
impl<T> LinkedList<T>
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn is_full(&self) -> bool
pub fn reserve(&mut self, capacity: usize)
pub fn get_mut(&mut self, link: &Link) -> Result<&mut Node<T>, ListError>
pub fn get_mut_value(&mut self, link: &Link) -> Result<&mut T, ListError>
pub fn get(&self, link: &Link) -> Result<&Node<T>, ListError>
pub fn push_front(&mut self, value: T) -> Result<Link, ListError>
pub fn push_back(&mut self, value: T) -> Result<Link, ListError>
pub fn head(&self) -> Option<Link>
pub fn tail(&self) -> Option<Link>
pub fn peek_front(&self) -> Result<&T, ListError>
pub fn peek_back(&self) -> Result<&T, ListError>
pub fn pop_front(&mut self) -> Result<T, ListError>
pub fn pop_back(&mut self) -> Result<T, ListError>
pub fn remove(&mut self, link: &Link) -> Result<T, ListError>
sourcepub fn reposition_to_tail(&mut self, link: &Link) -> Result<(), ListError>
pub fn reposition_to_tail(&mut self, link: &Link) -> Result<(), ListError>
Re-arranges the nodes in the linked list to make the node pointed to by the given Link the tail node.
pub fn iter(&self) -> Iter<'_, T>ⓘNotable traits for Iter<'a, T>impl<'a, T: 'a> Iterator for Iter<'a, T> type Item = &'a T;
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for LinkedList<T> where
T: RefUnwindSafe,
impl<T> Send for LinkedList<T> where
T: Send,
impl<T> Sync for LinkedList<T> where
T: Sync,
impl<T> Unpin for LinkedList<T> where
T: Unpin,
impl<T> UnwindSafe for LinkedList<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more