Struct linked_array::Cons
[−]
[src]
pub struct Cons<T, L>(pub T, pub L);
The type used for a non-empty array. Analogous to a cons cell in a linked list.
Trait Implementations
impl<T: Copy, L: Copy> Copy for Cons<T, L>
[src]
impl<T: Clone, L: Clone> Clone for Cons<T, L>
[src]
fn clone(&self) -> Cons<T, L>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: Debug, L: Debug> Debug for Cons<T, L>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<T: PartialEq, L: PartialEq> PartialEq for Cons<T, L>
[src]
fn eq(&self, __arg_0: &Cons<T, L>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Cons<T, L>) -> bool
[src]
This method tests for !=
.
impl<T: Eq, L: Eq> Eq for Cons<T, L>
[src]
impl<T: PartialOrd, L: PartialOrd> PartialOrd for Cons<T, L>
[src]
fn partial_cmp(&self, __arg_0: &Cons<T, L>) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Cons<T, L>) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Cons<T, L>) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Cons<T, L>) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Cons<T, L>) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T: Ord, L: Ord> Ord for Cons<T, L>
[src]
fn cmp(&self, __arg_0: &Cons<T, L>) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl<T, L: Array<T>> Array<T> for Cons<T, L>
[src]
fn get(&self, idx: usize) -> Option<&T>
[src]
Access the element at idx, or None if out of bounds.
fn len() -> usize
[src]
Get the compile-time length of the array.
unsafe fn as_slice(&self) -> &[T]
[src]
Since the in-memory representation should be the same as a traditional array, it should be safe to read the pointer as one. However, since the rust specification makes memory layout undefined, it is held behind unsafe. Read more
fn size(&self) -> usize
[src]
A conveinence wrapper around len that takes a refernce to facilitate using the right type.