[−][src]Struct mail::header_components::MessageIdList
Methods from Deref<Target = Vec1<MessageId>>
pub fn mapped_ref<F, N>(&self, map_fn: F) -> Vec1<N> where
F: FnMut(&T) -> N,
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,
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>,
F: FnMut(&T) -> Result<N, E>,
Create a new Vec1
by mapping references to the elements of self
to Result
s.
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>,
F: FnMut(&mut T) -> Result<N, E>,
Create a new Vec1
by mapping mutable references to the elements of
self
to Result
s.
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>,
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,
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>,
&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]
fn clone(&self) -> MessageIdList
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for MessageIdList
[src]
impl Deref for MessageIdList
[src]
type Target = Vec1<MessageId>
The resulting type after dereferencing.
fn deref(&self) -> &<MessageIdList as Deref>::Target
[src]
impl DerefMut for MessageIdList
[src]
fn deref_mut(&mut self) -> &mut <MessageIdList as Deref>::Target
[src]
impl<'de> Deserialize<'de> for MessageIdList
[src]
fn deserialize<__D>(
__deserializer: __D
) -> Result<MessageIdList, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
__deserializer: __D
) -> Result<MessageIdList, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl EncodableInHeader for MessageIdList
[src]
fn encode(&self, handle: &mut EncodingWriter) -> Result<(), EncodingError>
[src]
fn boxed_clone(&self) -> Box<dyn EncodableInHeader + 'static>
[src]
impl Serialize for MessageIdList
[src]
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Auto Trait Implementations
impl RefUnwindSafe for MessageIdList
impl Send for MessageIdList
impl Sync for MessageIdList
impl Unpin for MessageIdList
impl UnwindSafe for MessageIdList
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T> HeaderTryFrom<T> for T
[src]
fn try_from(val: T) -> Result<T, ComponentCreationError>
[src]
impl<F, T> HeaderTryInto<T> for F where
T: HeaderTryFrom<F>,
[src]
T: HeaderTryFrom<F>,
fn try_into(self) -> Result<T, ComponentCreationError>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,