pub struct NonEmpty<T>(pub Vec<T>);
Expand description
A non-empty Vec
. It has at least one element.
Tuple Fields§
§0: Vec<T>
Implementations§
source§impl<T> NonEmpty<T>
impl<T> NonEmpty<T>
sourcepub fn from_non_empty_iter<I>(iter: I) -> Option<Self>where
I: IntoIterator<Item = T>,
pub fn from_non_empty_iter<I>(iter: I) -> Option<Self>where
I: IntoIterator<Item = T>,
Trait Implementations§
source§impl<T> Extend<T> for NonEmpty<T>
impl<T> Extend<T> for NonEmpty<T>
source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = T>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = T>,
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl<'a, T> IntoIterator for &'a NonEmpty<T>
impl<'a, T> IntoIterator for &'a NonEmpty<T>
source§impl<'a, T> IntoIterator for &'a mut NonEmpty<T>
impl<'a, T> IntoIterator for &'a mut NonEmpty<T>
source§impl<T> IntoIterator for NonEmpty<T>
impl<T> IntoIterator for NonEmpty<T>
source§impl<T: PartialEq> PartialEq for NonEmpty<T>
impl<T: PartialEq> PartialEq for NonEmpty<T>
impl<T> StructuralPartialEq for NonEmpty<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for NonEmpty<T>where
T: RefUnwindSafe,
impl<T> Send for NonEmpty<T>where
T: Send,
impl<T> Sync for NonEmpty<T>where
T: Sync,
impl<T> Unpin for NonEmpty<T>where
T: Unpin,
impl<T> UnwindSafe for NonEmpty<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more