[][src]Struct static_linkedlist::StaticLinkedList

pub struct StaticLinkedList<'buf, T> where
    T: Clear
{ /* fields omitted */ }

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]

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(
    &mut self,
    predicate: fn(_: &T) -> bool
) -> Result<&mut Self, Error>
[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]

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]

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?

Auto Trait Implementations

impl<'buf, T> !Send 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]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> From for T
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]