[−][src]Struct static_linkedlist::StaticLinkedList
A singly-linked list for elements of type T backed by a static array.
Methods
impl<'buf, T> StaticLinkedList<'buf, T> where
T: Clear,
[src]
impl<'buf, T> StaticLinkedList<'buf, T> where
T: Clear,
pub fn size(&self) -> usize | [src] |
Returns the number of elements stored in the list.
pub fn free_space(&self) -> usize | [src] |
Returns the remaining space in this list's backing array (in units of T
).
pub fn append(&mut self, data: T) -> Result<(), Error> | [src] |
Appends T to the end of the list.
pub fn prepend(&mut self, data: T) -> Result<&mut Self, Error> | [src] |
Prepends T to the list's head.
pub fn head(&self) -> Option<&T> | [src] |
Returns a reference to the first element in the list.
pub fn tail(&self) -> Option<&T> | [src] |
Returns a reference to the last element in the list.
pub fn at(&self, index: usize) -> Result<&T, Error> | [src] |
Returns a reference to the list element at 'index'.
pub fn remove_head(&mut self) -> Result<&mut Self, Error> | [src] |
Removes the first element from the list.
pub fn remove_all_satisfying( | [src] |
Removes all elements e
from the list where predicate(e) == true
.
Trait Implementations
impl<'buf, T> Drop for StaticLinkedList<'buf, T> where
T: Clear,
[src]
impl<'buf, T> Drop for StaticLinkedList<'buf, T> where
T: Clear,
Ensures that the memory occupied by the list is returned to its backing array when it goes out of scope.
impl<'l, 'buf, T> IntoIterator for &'l StaticLinkedList<'buf, T> where
T: Clear,
[src]
impl<'l, 'buf, T> IntoIterator for &'l StaticLinkedList<'buf, T> where
T: Clear,
type Item = &'l T
The type of the elements being iterated over.
type IntoIter = StaticLinkedListIterator<'l, T>
Which kind of iterator are we turning this into?
ⓘImportant traits for StaticLinkedListIterator<'a, T>
fn into_iter(self) -> StaticLinkedListIterator<'l, T> | [src] |
Auto Trait Implementations
impl<'buf, T> !Send for StaticLinkedList<'buf, T>
impl<'buf, T> !Send for StaticLinkedList<'buf, T>
impl<'buf, T> !Sync for StaticLinkedList<'buf, T>
impl<'buf, T> !Sync for StaticLinkedList<'buf, T>
Blanket Implementations
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |