Enum immutable::list::List
[−]
[src]
pub enum List<E> { Empty, Cons(E, Rc<List<E>>), }
Variants
Empty
Cons(E, Rc<List<E>>)
Methods
impl<E: Clone> List<E>
[src]
fn empty() -> List<E>
fn cons<T: Borrow<List<E>>>(head: E, _tail: T) -> List<E>
fn is_empty(&self) -> bool
fn head(&self) -> E
fn tail(&self) -> Rc<List<E>>
fn length(&self) -> usize
fn append<T: Borrow<List<E>>>(&self, lst: T) -> Self
fn safe_head(&self) -> Option<E>
fn safe_tail(&self) -> Option<Rc<List<E>>>
Trait Implementations
impl<E: Clone> Clone for List<E>
[src]
fn clone(&self) -> List<E>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<E: PartialEq> PartialEq for List<E>
[src]
fn eq(&self, __arg_0: &List<E>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &List<E>) -> bool
This method tests for !=
.
impl<E: Eq> Eq for List<E>
[src]
impl<E: Debug + Clone> Debug for List<E>
[src]
impl<E: Clone> FromIterator<E> for List<E>
[src]
fn from_iter<I: IntoIterator<Item = E>>(iterator: I) -> Self
Creates a value from an iterator. Read more