[][src]Struct mail::header_components::MessageIdList

pub struct MessageIdList(pub Vec1<MessageId>);

Methods from Deref<Target = Vec1<MessageId>>

pub fn mapped_ref<F, N>(&self, map_fn: F) -> Vec1<N> where
    F: FnMut(&T) -> N, 

Create a new Vec1 by mapping references to the elements of self.

The benefit to this compared to Iterator::map is that it's known that the length will still be at least 1 when creating the new Vec1.

pub fn mapped_mut<F, N>(&mut self, map_fn: F) -> Vec1<N> where
    F: FnMut(&mut T) -> N, 

Create a new Vec1 by mapping mutable references to the elements of self.

The benefit to this compared to Iterator::map is that it's known that the length will still be at least 1 when creating the new Vec1.

pub fn try_mapped_ref<F, N, E>(&self, map_fn: F) -> Result<Vec1<N>, E> where
    F: FnMut(&T) -> Result<N, E>, 

Create a new Vec1 by mapping references to the elements of self to Results.

The benefit to this compared to Iterator::map is that it's known that the length will still be at least 1 when creating the new Vec1.

Errors

Once any call to map_fn returns a error that error is directly returned by this method.

pub fn try_mapped_mut<F, N, E>(&mut self, map_fn: F) -> Result<Vec1<N>, E> where
    F: FnMut(&mut T) -> Result<N, E>, 

Create a new Vec1 by mapping mutable references to the elements of self to Results.

The benefit to this compared to Iterator::map is that it's known that the length will still be at least 1 when creating the new Vec1.

Errors

Once any call to map_fn returns a error that error is directly returned by this method.

pub fn last(&self) -> &T

Returns a reference to the last element.

As Vec1 always contains at least one element there is always a last element.

pub fn last_mut(&mut self) -> &mut T

Returns a mutable reference to the last element.

As Vec1 always contains at least one element there is always a last element.

pub fn first(&self) -> &T

Returns a reference to the first element.

As Vec1 always contains at least one element there is always a first element.

pub fn first_mut(&mut self) -> &mut T

Returns a mutable reference to the first element.

As Vec1 always contains at least one element there is always a first element.

pub fn try_truncate(&mut self, len: usize) -> Result<(), Size0Error>

Truncates the vec1 to given length.

Errors

If len is 0 an error is returned as the length >= 1 constraint must be uphold.

pub fn try_swap_remove(&mut self, index: usize) -> Result<T, Size0Error>

Calls swap_remove on the inner vec if length >= 2.

Errors

If len is 1 an error is returned as the length >= 1 constraint must be uphold.

pub fn try_remove(&mut self, index: usize) -> Result<T, Size0Error>

Calls remove on the inner vec if length >= 2.

Errors

If len is 1 an error is returned as the length >= 1 constraint must be uphold.

pub fn try_split_off(&mut self, at: usize) -> Result<Vec1<T>, Size0Error>

Calls split_of on the inner vec if both resulting parts have length >= 1.

Errors

If after the split any part would be empty an error is returned as the length >= 1 constraint must be uphold.

pub fn dedup_by_key<F, K>(&mut self, key: F) where
    F: FnMut(&mut T) -> K,
    K: PartialEq<K>, 

Calls dedup_by_key on the inner vec.

While this can remove elements it will never produce a empty vector from an non empty vector.

pub fn dedup_by<F>(&mut self, same_bucket: F) where
    F: FnMut(&mut T, &mut T) -> bool

Calls dedup_by_key on the inner vec.

While this can remove elements it will never produce a empty vector from an non empty vector.

pub fn try_pop(&mut self) -> Result<T, Size0Error>

Tries to remove the last element from the Vec1.

Returns an error if the length is currently 1 (so the try_pop would reduce the length to 0).

Errors

If len is 1 an error is returned as the length >= 1 constraint must be uphold.

pub fn as_vec(&self) -> &Vec<T>

Return a reference to the underlying Vec.

pub fn splice<R, I>(
    &mut self,
    range: R,
    replace_with: I
) -> Result<Splice<<I as IntoIterator>::IntoIter>, Size0Error> where
    I: IntoIterator<Item = T>,
    R: RangeBounds<usize>, 

Calls splice on the underlying vec if it will not produce an empty vec.

Errors

If range covers the whole vec and the replacement iterator doesn't yield any value an error is returned.

This means that if an error is returned next might still have been called once on the replace_with iterator.

pub fn to_ascii_uppercase(&self) -> Vec1<u8>

Works like &[u8].to_ascii_uppercase() but returns a Vec1<T> instead of a Vec<T>

pub fn to_ascii_lowercase(&self) -> Vec1<u8>

Works like &[u8].to_ascii_lowercase() but returns a Vec1<T> instead of a Vec<T>

pub fn try_resize(&mut self, new_len: usize, value: T) -> Result<(), Size0Error>

Calls resize on the underlying Vec if new_len >= 1.

Errors

If the new_len is 0 an error is returned as the length >= 1 constraint must be uphold.

pub fn extend_from_slice(&mut self, other: &[T])

pub fn dedub(&mut self)

pub fn dedup(&mut self)

pub fn reserve(&mut self, additional: usize)

pub fn reserve_exact(&mut self, additional: usize)

pub fn shrink_to_fit(&mut self)

pub fn as_mut_slice(&mut self) -> &mut [T]

pub fn push(&mut self, value: T)

pub fn append(&mut self, other: &mut Vec<T>)

pub fn insert(&mut self, idx: usize, val: T)

pub fn len(&self) -> usize

pub fn capacity(&self) -> usize

pub fn as_slice(&self) -> &[T]

Trait Implementations

impl Clone for MessageIdList[src]

impl Debug for MessageIdList[src]

impl Deref for MessageIdList[src]

type Target = Vec1<MessageId>

The resulting type after dereferencing.

impl DerefMut for MessageIdList[src]

impl<'de> Deserialize<'de> for MessageIdList[src]

impl EncodableInHeader for MessageIdList[src]

impl Serialize for MessageIdList[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T> HeaderTryFrom<T> for T[src]

impl<F, T> HeaderTryInto<T> for F where
    T: HeaderTryFrom<F>, 
[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.