Struct recrypt::nonemptyvec::NonEmptyVec [−]
pub struct NonEmptyVec<T> { /* fields omitted */ }
A simple-minded NonEmptyVec implementation
Methods
impl<T> NonEmptyVec<T> where
T: Clone,
impl<T> NonEmptyVec<T> where
T: Clone,
pub fn new_first(first: T) -> Self
pub fn new_first(first: T) -> Self
pub fn new(first: T, rest: Vec<T>) -> Self
pub fn new(first: T, rest: Vec<T>) -> Self
pub fn new_last(first_v: &[T], tail: NonEmptyVec<T>) -> Self
pub fn new_last(first_v: &[T], tail: NonEmptyVec<T>) -> Self
pub fn first(&self) -> &T
pub fn first(&self) -> &T
pub fn rest(&self) -> &Vec<T>
pub fn rest(&self) -> &Vec<T>
pub fn to_vec(&self) -> Vec<T>
pub fn to_vec(&self) -> Vec<T>
pub fn try_from(v: &[T]) -> Result<NonEmptyVec<T>, EmptyVectorErr>
pub fn try_from(v: &[T]) -> Result<NonEmptyVec<T>, EmptyVectorErr>
pub fn concat(&self, b: &NonEmptyVec<T>) -> NonEmptyVec<T>
pub fn concat(&self, b: &NonEmptyVec<T>) -> NonEmptyVec<T>
pub fn last(&self) -> &T
pub fn last(&self) -> &T
pub fn len(&self) -> usize
pub fn len(&self) -> usize
Trait Implementations
impl<T: Debug> Debug for NonEmptyVec<T>
impl<T: Debug> Debug for NonEmptyVec<T>
impl<T: PartialEq> PartialEq for NonEmptyVec<T>
impl<T: PartialEq> PartialEq for NonEmptyVec<T>
fn eq(&self, other: &NonEmptyVec<T>) -> bool
fn eq(&self, other: &NonEmptyVec<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &NonEmptyVec<T>) -> bool
fn ne(&self, other: &NonEmptyVec<T>) -> bool
This method tests for !=
.
impl<T: Eq> Eq for NonEmptyVec<T>
impl<T: Eq> Eq for NonEmptyVec<T>
impl<T: Clone> Clone for NonEmptyVec<T>
impl<T: Clone> Clone for NonEmptyVec<T>
fn clone(&self) -> NonEmptyVec<T>
fn clone(&self) -> NonEmptyVec<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<T> Into<Vec<T>> for NonEmptyVec<T>
impl<T> Into<Vec<T>> for NonEmptyVec<T>
Auto Trait Implementations
impl<T> Send for NonEmptyVec<T> where
T: Send,
impl<T> Send for NonEmptyVec<T> where
T: Send,
impl<T> Sync for NonEmptyVec<T> where
T: Sync,
impl<T> Sync for NonEmptyVec<T> where
T: Sync,