pub struct NonEmpty<T: ?Sized> { /* private fields */ }
Expand description
A wrapper struct around non-empty slices/arrays/vectors.
You may wish to use the following type aliases instead:
See also crate documentation
Implementations§
source§impl<const N: usize, T> NonEmpty<[T; N]>
impl<const N: usize, T> NonEmpty<[T; N]>
Array
methods
sourcepub const unsafe fn new_ref_unchecked(src: &[T; N]) -> &Self
pub const unsafe fn new_ref_unchecked(src: &[T; N]) -> &Self
sourcepub unsafe fn new_mut_unchecked(src: &mut [T; N]) -> &mut Self
pub unsafe fn new_mut_unchecked(src: &mut [T; N]) -> &mut Self
sourcepub const unsafe fn new_unchecked(src: [T; N]) -> Self
pub const unsafe fn new_unchecked(src: [T; N]) -> Self
sourcepub fn each_ref(&self) -> Array<&T, N>
pub fn each_ref(&self) -> Array<&T, N>
Borrows each element and returns a NonEmpty
array of references with the same size as self.
sourcepub fn each_mut(&mut self) -> Array<&mut T, N>
pub fn each_mut(&mut self) -> Array<&mut T, N>
Borrows each element mutably and returns a NonEmpty
array of mutable references with the same size as self.
sourcepub fn each_map<F, U>(self, f: F) -> Array<U, N>where
F: FnMut(T) -> U,
pub fn each_map<F, U>(self, f: F) -> Array<U, N>where
F: FnMut(T) -> U,
Returns a NonEmpty
array of the same size as self, with function f applied to each element in order.
sourcepub const fn as_slice_ne(&self) -> &Slice<T>
pub const fn as_slice_ne(&self) -> &Slice<T>
Returns a NonEmpty
slice.
sourcepub fn as_mut_slice_ne(&mut self) -> &mut Slice<T>
pub fn as_mut_slice_ne(&mut self) -> &mut Slice<T>
Returns a NonEmpty
slice.
sourcepub const fn as_array(&self) -> &[T; N]
pub const fn as_array(&self) -> &[T; N]
Returns a primitive array
.
sourcepub fn as_mut_array(&mut self) -> &mut [T; N]
pub fn as_mut_array(&mut self) -> &mut [T; N]
Returns a primitive array
.
sourcepub fn into_array(self) -> [T; N]
pub fn into_array(self) -> [T; N]
Returns a primitive array
.
source§impl<T, const N: usize> NonEmpty<[T; N]>
impl<T, const N: usize> NonEmpty<[T; N]>
Known non-empty iterator for Array
.
pub fn into_iter_ne(self) -> NonEmpty<IntoIter<T, N>>
source§impl<I> NonEmpty<I>where
I: Iterator,
impl<I> NonEmpty<I>where
I: Iterator,
Methods on Iterator
s with a non-empty invariant.
See Self::relax
to access the normal iterator inside.
sourcepub fn first(self) -> I::Item
pub fn first(self) -> I::Item
NonEmpty
version of Iterator::next
.
let v = vec![1, 2, 3];
let _: Option<&u8> = v.iter().next();
// ^ normally you have to handle the empty case
let _: &u8 = v.iter_ne().first();
// ^ but we know there is at least one element
sourcepub fn last(self) -> I::Item
pub fn last(self) -> I::Item
NonEmpty
version of Iterator::last
.
let v = vec![1, 2, 3];
let _: Option<&u8> = v.iter().last();
// ^ normally you have to handle the empty case
let _: &u8 = v.iter_ne().last();
// ^ but we know there is at least one element
sourcepub fn map<B, F>(self, f: F) -> NonEmpty<Map<I, F>>
pub fn map<B, F>(self, f: F) -> NonEmpty<Map<I, F>>
NonEmpty
version of Iterator::map
.
let iter = slice![1, 2, 3].iter_ne();
assert_eq!(
iter.map(|it| *it * 2).last(),
// ^ the invariant is maintained
// so we _know_ there's a last element
6
);
sourcepub fn chain<U>(
self,
other: U,
) -> NonEmpty<Chain<I, <U as IntoIterator>::IntoIter>>where
U: IntoIterator<Item = I::Item>,
pub fn chain<U>(
self,
other: U,
) -> NonEmpty<Chain<I, <U as IntoIterator>::IntoIter>>where
U: IntoIterator<Item = I::Item>,
NonEmpty
version of Iterator::chain
.
let iter = slice![1, 2].iter_ne();
assert_eq!(
iter.chain(&[3]).last(),
// ^ the invariant is maintained
// so we _know_ there's a last element
&3
);
sourcepub fn enumerate(self) -> NonEmpty<Enumerate<I>>
pub fn enumerate(self) -> NonEmpty<Enumerate<I>>
NonEmpty
version of Iterator::enumerate
.
let iter = slice!['a', 'b'].iter_ne();
assert_eq!(
iter.enumerate().last(),
// ^ the invariant is maintained
// so we _know_ there's a last element
(1, &'b')
);
sourcepub fn peekable(self) -> NonEmpty<Peekable<I>>
pub fn peekable(self) -> NonEmpty<Peekable<I>>
NonEmpty
version of Iterator::peekable
, allowing you to use
Self::peek
and Self::peek_mut
let mut peek_me = vec!['a', 'b'].into_iter_ne().peekable();
assert_eq!(
*peek_me.peek(),
'a'
);
*peek_me.peek_mut() = 'b';
assert_eq!(
peek_me.collect_vec(),
['b', 'b']
);
sourcepub fn take(self, n: NonZeroUsize) -> NonEmpty<Take<I>>
pub fn take(self, n: NonZeroUsize) -> NonEmpty<Take<I>>
NonEmpty
version of Iterator::take
.
Note that n
cannot be zero, to maintain the NonEmpty
invariant.
let iter = slice!['a', 'b'].iter_ne();
assert_eq!(
iter.take(nonzero!(1)).last(),
// ^ compile time checked
&'a'
)
sourcepub fn flatten<II, T>(self) -> NonEmpty<FlatMap<I, II, fn(_: I::Item) -> II>>
pub fn flatten<II, T>(self) -> NonEmpty<FlatMap<I, II, fn(_: I::Item) -> II>>
NonEmpty
version of Iterator::flatten
.
Note that the inner items must also be NonEmpty
, to maintain the invariant.
use nunny::{vec};
let nested = vec![vec![1], vec![2, 3]];
assert_eq!(
nested.into_iter_ne().flatten().collect_vec(),
[1, 2, 3],
);
sourcepub fn inspect<F>(self, f: F) -> NonEmpty<Inspect<I, F>>
pub fn inspect<F>(self, f: F) -> NonEmpty<Inspect<I, F>>
NonEmpty
version of Iterator::inspect
.
sourcepub fn reduce<F>(self, f: F) -> I::Item
pub fn reduce<F>(self, f: F) -> I::Item
NonEmpty
version of Iterator::reduce
.
let v = vec![1, 2, 3];
let _: Option<&u8> = v.iter().reduce(min);
// ^ normally you have to handle the empty case
let _: &u8 = v.iter_ne().reduce(min);
// ^ but we know there is at least one element
sourcepub fn max(self) -> I::Item
pub fn max(self) -> I::Item
NonEmpty
version of Iterator::max
.
let v = vec![1, 2, 3];
let _: Option<&u8> = v.iter().max();
// ^ normally you have to handle the empty case
let _: &u8 = v.iter_ne().max();
// ^ but we know there is at least one element
sourcepub fn min(self) -> I::Item
pub fn min(self) -> I::Item
NonEmpty
version of Iterator::min
.
let v = vec![1, 2, 3];
let _: Option<&u8> = v.iter().min();
// ^ normally you have to handle the empty case
let _: &u8 = v.iter_ne().min();
// ^ but we know there is at least one element
sourcepub fn max_by_key<B, F>(self, f: F) -> I::Item
pub fn max_by_key<B, F>(self, f: F) -> I::Item
NonEmpty
version of Iterator::max_by_key
.
sourcepub fn max_by<F>(self, compare: F) -> I::Item
pub fn max_by<F>(self, compare: F) -> I::Item
NonEmpty
version of Iterator::max_by
.
sourcepub fn min_by_key<B, F>(self, f: F) -> I::Item
pub fn min_by_key<B, F>(self, f: F) -> I::Item
NonEmpty
version of Iterator::min_by_key
.
sourcepub fn min_by<F>(self, compare: F) -> I::Item
pub fn min_by<F>(self, compare: F) -> I::Item
NonEmpty
version of Iterator::min_by
.
sourcepub fn rev(self) -> NonEmpty<Rev<I>>where
I: DoubleEndedIterator,
pub fn rev(self) -> NonEmpty<Rev<I>>where
I: DoubleEndedIterator,
NonEmpty
version of Iterator::rev
.
sourcepub fn relax(self) -> I
pub fn relax(self) -> I
Remove the NonEmpty
wrapper, allowing you to access normal iterator
methods like Iterator::filter
.
sourcepub fn collect_vec(self) -> Vec<I::Item>
pub fn collect_vec(self) -> Vec<I::Item>
Collect this iterator into a NonEmpty<Vec>
.
sourcepub fn try_collect_vec<T, E>(self) -> Result<Vec<T>, E>
pub fn try_collect_vec<T, E>(self) -> Result<Vec<T>, E>
Collect Ok
items into a NonEmpty<Vec>
, short-circuiting on Err
.
source§impl<I> NonEmpty<Peekable<I>>where
I: Iterator,
impl<I> NonEmpty<Peekable<I>>where
I: Iterator,
sourcepub fn peek(&mut self) -> &I::Item
pub fn peek(&mut self) -> &I::Item
Peek this NonEmpty
iterator, without advancing it.
See Self::peekable
.
sourcepub fn peek_mut(&mut self) -> &mut I::Item
pub fn peek_mut(&mut self) -> &mut I::Item
Peek and modify this NonEmpty
iterator, without advancing it.
See Self::peekable
.
source§impl<T> NonEmpty<[T]>
impl<T> NonEmpty<[T]>
Slice
methods
sourcepub const unsafe fn new_unchecked(src: &[T]) -> &Self
pub const unsafe fn new_unchecked(src: &[T]) -> &Self
sourcepub unsafe fn new_mut_unchecked(src: &mut [T]) -> &mut Self
pub unsafe fn new_mut_unchecked(src: &mut [T]) -> &mut Self
sourcepub const fn as_slice(&self) -> &[T]
pub const fn as_slice(&self) -> &[T]
Returns a primitive slice
.
sourcepub fn as_mut_slice(&mut self) -> &mut [T]
pub fn as_mut_slice(&mut self) -> &mut [T]
Returns a primitive slice
.
sourcepub const fn len_ne(&self) -> NonZeroUsize
pub const fn len_ne(&self) -> NonZeroUsize
Returns the known non-zero length.
sourcepub const fn split_first(&self) -> (&T, &[T])
pub const fn split_first(&self) -> (&T, &[T])
Returns the first element, guaranteed, and the rest of the elements.
sourcepub const fn split_last(&self) -> (&T, &[T])
pub const fn split_last(&self) -> (&T, &[T])
Returns the last element, guaranteed, and the rest of the elements.
sourcepub fn split_first_mut(&mut self) -> (&mut T, &mut [T])
pub fn split_first_mut(&mut self) -> (&mut T, &mut [T])
Returns the first element, guaranteed, and the rest of the elements.
sourcepub fn split_last_mut(&mut self) -> (&mut T, &mut [T])
pub fn split_last_mut(&mut self) -> (&mut T, &mut [T])
Returns the last element, guaranteed, and the rest of the elements.
source§impl<T> NonEmpty<Vec<T>>
impl<T> NonEmpty<Vec<T>>
Vec
methods
sourcepub unsafe fn new_unchecked(src: Vec<T>) -> Self
pub unsafe fn new_unchecked(src: Vec<T>) -> Self
sourcepub unsafe fn new_ref_unchecked(src: &Vec<T>) -> &Self
pub unsafe fn new_ref_unchecked(src: &Vec<T>) -> &Self
sourcepub unsafe fn new_mut_unchecked(src: &mut Vec<T>) -> &mut Self
pub unsafe fn new_mut_unchecked(src: &mut Vec<T>) -> &mut Self
sourcepub fn new(src: Vec<T>) -> Result<Self, Vec<T>>
pub fn new(src: Vec<T>) -> Result<Self, Vec<T>>
Create a new NonEmpty
heap-allocated vec, returning the original
allocation if it was empty.
sourcepub fn of_with_capacity(item: T, capacity: usize) -> Self
pub fn of_with_capacity(item: T, capacity: usize) -> Self
Create a NonEmpty
heap-allocated vec, of a single element, with
capacity for capacity
elements without (re)-allocating.
sourcepub fn of_extending<A>(first: T, rest: impl IntoIterator<Item = A>) -> Selfwhere
Self: Extend<A>,
pub fn of_extending<A>(first: T, rest: impl IntoIterator<Item = A>) -> Selfwhere
Self: Extend<A>,
Creating a NonEmpty
heap-allocated vec where the first element is known.
This is an convenience method, equivalent to
let mut it = nunny::vec!["first"];
it.extend(["this", "is", "the", "rest"]);
sourcepub fn filled(value: T, len: NonZeroUsize) -> Selfwhere
T: Clone,
pub fn filled(value: T, len: NonZeroUsize) -> Selfwhere
T: Clone,
Create a NonEmpty
heap-allocated vec with len
items, filled with
Clone
s of the given value
.
See also Self::filled_with
.
sourcepub fn filled_with<F>(f: F, len: NonZeroUsize) -> Selfwhere
F: FnMut() -> T,
pub fn filled_with<F>(f: F, len: NonZeroUsize) -> Selfwhere
F: FnMut() -> T,
Create a NonEmpty
heap-allocated vec with len
items, filled with
values returned from repeating the closure f
.
See also Self::filled
.
sourcepub fn as_vec(&self) -> &Vec<T>
pub fn as_vec(&self) -> &Vec<T>
Returns a std::vec::Vec
.
sourcepub unsafe fn as_mut_vec(&mut self) -> &mut Vec<T>
pub unsafe fn as_mut_vec(&mut self) -> &mut Vec<T>
sourcepub fn into_vec(self) -> Vec<T>
pub fn into_vec(self) -> Vec<T>
Returns a std::vec::Vec
.
sourcepub fn as_slice_ne(&self) -> &Slice<T>
pub fn as_slice_ne(&self) -> &Slice<T>
Returns a NonEmpty
slice.
sourcepub fn as_mut_slice_ne(&mut self) -> &mut Slice<T>
pub fn as_mut_slice_ne(&mut self) -> &mut Slice<T>
Returns a NonEmpty
slice.
sourcepub fn capacity(&self) -> NonZeroUsize
pub fn capacity(&self) -> NonZeroUsize
Returns the known non-zero length.
sourcepub fn reserve_exact(&mut self, additional: usize)
pub fn reserve_exact(&mut self, additional: usize)
See reserve_exact
.
sourcepub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
See try_reserve
.
sourcepub fn try_reserve_exact(
&mut self,
additional: usize,
) -> Result<(), TryReserveError>
pub fn try_reserve_exact( &mut self, additional: usize, ) -> Result<(), TryReserveError>
See try_reserve_exact
.
sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
See shrink_to_fit
.
sourcepub fn into_boxed_slice(self) -> Box<Slice<T>>
pub fn into_boxed_slice(self) -> Box<Slice<T>>
Return a NonEmpty
boxed slice.
sourcepub fn truncate(&mut self, len: NonZeroUsize)
pub fn truncate(&mut self, len: NonZeroUsize)
Shortens the vector to a guaranteed-nonzero length
See truncate
.
sourcepub unsafe fn set_len(&mut self, new_len: NonZeroUsize)
pub unsafe fn set_len(&mut self, new_len: NonZeroUsize)
sourcepub fn dedup_by_key<F, K>(&mut self, key: F)
pub fn dedup_by_key<F, K>(&mut self, key: F)
See dedup_by_key
.
sourcepub fn resize_with<F>(&mut self, new_len: NonZeroUsize, f: F)where
F: FnMut() -> T,
pub fn resize_with<F>(&mut self, new_len: NonZeroUsize, f: F)where
F: FnMut() -> T,
See resize_with
.
sourcepub fn spare_capacity_mut(&mut self) -> &mut [MaybeUninit<T>]
pub fn spare_capacity_mut(&mut self) -> &mut [MaybeUninit<T>]
See spare_capacity_mut
.
Trait Implementations§
source§impl<T, const N: usize> BorrowMut<NonEmpty<[T]>> for Array<T, N>
impl<T, const N: usize> BorrowMut<NonEmpty<[T]>> for Array<T, N>
source§fn borrow_mut(&mut self) -> &mut Slice<T>
fn borrow_mut(&mut self) -> &mut Slice<T>
source§impl<T> BorrowMut<NonEmpty<[T]>> for Vec<T>
impl<T> BorrowMut<NonEmpty<[T]>> for Vec<T>
source§fn borrow_mut(&mut self) -> &mut Slice<T>
fn borrow_mut(&mut self) -> &mut Slice<T>
source§impl<A, B, const N: usize> PartialEq<&NonEmpty<[B]>> for Array<A, N>where
A: PartialEq<B>,
impl<A, B, const N: usize> PartialEq<&NonEmpty<[B]>> for Array<A, N>where
A: PartialEq<B>,
source§impl<T, U> PartialEq<&NonEmpty<[U]>> for Cow<'_, Slice<T>>
impl<T, U> PartialEq<&NonEmpty<[U]>> for Cow<'_, Slice<T>>
source§impl<T, U> PartialEq<&NonEmpty<[U]>> for Vec<T>where
T: PartialEq<U>,
impl<T, U> PartialEq<&NonEmpty<[U]>> for Vec<T>where
T: PartialEq<U>,
source§impl<T, U> PartialEq<&NonEmpty<[U]>> for VecDeque<T>where
T: PartialEq<U>,
impl<T, U> PartialEq<&NonEmpty<[U]>> for VecDeque<T>where
T: PartialEq<U>,
source§impl<T, U, const N: usize> PartialEq<&NonEmpty<[U; N]>> for Vec<T>where
T: PartialEq<U>,
impl<T, U, const N: usize> PartialEq<&NonEmpty<[U; N]>> for Vec<T>where
T: PartialEq<U>,
source§impl<T, U, const N: usize> PartialEq<&NonEmpty<[U; N]>> for VecDeque<T>where
T: PartialEq<U>,
impl<T, U, const N: usize> PartialEq<&NonEmpty<[U; N]>> for VecDeque<T>where
T: PartialEq<U>,
source§impl<A, B, const N: usize> PartialEq<&mut NonEmpty<[B]>> for Array<A, N>where
A: PartialEq<B>,
impl<A, B, const N: usize> PartialEq<&mut NonEmpty<[B]>> for Array<A, N>where
A: PartialEq<B>,
source§impl<T, U> PartialEq<&mut NonEmpty<[U]>> for Cow<'_, Slice<T>>
impl<T, U> PartialEq<&mut NonEmpty<[U]>> for Cow<'_, Slice<T>>
source§impl<T, U> PartialEq<&mut NonEmpty<[U]>> for Vec<T>where
T: PartialEq<U>,
impl<T, U> PartialEq<&mut NonEmpty<[U]>> for Vec<T>where
T: PartialEq<U>,
source§impl<T, U> PartialEq<&mut NonEmpty<[U]>> for VecDeque<T>where
T: PartialEq<U>,
impl<T, U> PartialEq<&mut NonEmpty<[U]>> for VecDeque<T>where
T: PartialEq<U>,
source§impl<T, U, const N: usize> PartialEq<&mut NonEmpty<[U; N]>> for VecDeque<T>where
T: PartialEq<U>,
impl<T, U, const N: usize> PartialEq<&mut NonEmpty<[U; N]>> for VecDeque<T>where
T: PartialEq<U>,
source§impl<A, B, const N: usize> PartialEq<NonEmpty<[A; N]>> for &Slice<B>where
B: PartialEq<A>,
impl<A, B, const N: usize> PartialEq<NonEmpty<[A; N]>> for &Slice<B>where
B: PartialEq<A>,
source§impl<A, B, const N: usize> PartialEq<NonEmpty<[A; N]>> for &mut Slice<B>where
B: PartialEq<A>,
impl<A, B, const N: usize> PartialEq<NonEmpty<[A; N]>> for &mut Slice<B>where
B: PartialEq<A>,
source§impl<A, B, const N: usize> PartialEq<NonEmpty<[A; N]>> for Slice<B>where
B: PartialEq<A>,
impl<A, B, const N: usize> PartialEq<NonEmpty<[A; N]>> for Slice<B>where
B: PartialEq<A>,
source§impl<A, B> PartialEq<NonEmpty<[B]>> for Slice<A>where
A: PartialEq<B>,
impl<A, B> PartialEq<NonEmpty<[B]>> for Slice<A>where
A: PartialEq<B>,
source§impl<A, B, const N: usize> PartialEq<NonEmpty<[B]>> for Array<A, N>where
A: PartialEq<B>,
impl<A, B, const N: usize> PartialEq<NonEmpty<[B]>> for Array<A, N>where
A: PartialEq<B>,
source§impl<A, B, const N: usize> PartialEq<NonEmpty<[B; N]>> for Array<A, N>where
A: PartialEq<B>,
impl<A, B, const N: usize> PartialEq<NonEmpty<[B; N]>> for Array<A, N>where
A: PartialEq<B>,
source§impl<T, U> PartialEq<NonEmpty<[T]>> for [U]where
U: PartialEq<T>,
impl<T, U> PartialEq<NonEmpty<[T]>> for [U]where
U: PartialEq<T>,
source§impl<T, U, const N: usize> PartialEq<NonEmpty<[T]>> for [U; N]where
U: PartialEq<T>,
impl<T, U, const N: usize> PartialEq<NonEmpty<[T]>> for [U; N]where
U: PartialEq<T>,
source§impl<T, U> PartialEq<NonEmpty<[T]>> for Vec<U>where
U: PartialEq<T>,
impl<T, U> PartialEq<NonEmpty<[T]>> for Vec<U>where
U: PartialEq<T>,
source§impl<T, U, const N: usize> PartialEq<NonEmpty<[T; N]>> for [U]where
U: PartialEq<T>,
impl<T, U, const N: usize> PartialEq<NonEmpty<[T; N]>> for [U]where
U: PartialEq<T>,
source§impl<T, U, const N: usize> PartialEq<NonEmpty<[T; N]>> for [U; N]where
U: PartialEq<T>,
impl<T, U, const N: usize> PartialEq<NonEmpty<[T; N]>> for [U; N]where
U: PartialEq<T>,
source§impl<T, U, const N: usize> PartialEq<NonEmpty<[T; N]>> for Vec<U>where
U: PartialEq<T>,
impl<T, U, const N: usize> PartialEq<NonEmpty<[T; N]>> for Vec<U>where
U: PartialEq<T>,
source§impl<T, U> PartialEq<NonEmpty<[U]>> for Vec<T>where
T: PartialEq<U>,
impl<T, U> PartialEq<NonEmpty<[U]>> for Vec<T>where
T: PartialEq<U>,
source§impl<T, U, const N: usize> PartialEq<NonEmpty<[U; N]>> for Vec<T>where
T: PartialEq<U>,
impl<T, U, const N: usize> PartialEq<NonEmpty<[U; N]>> for Vec<T>where
T: PartialEq<U>,
source§impl<T, U, const N: usize> PartialEq<NonEmpty<[U; N]>> for VecDeque<T>where
T: PartialEq<U>,
impl<T, U, const N: usize> PartialEq<NonEmpty<[U; N]>> for VecDeque<T>where
T: PartialEq<U>,
source§impl<T, U> PartialEq<NonEmpty<Vec<T>>> for [U]where
U: PartialEq<T>,
impl<T, U> PartialEq<NonEmpty<Vec<T>>> for [U]where
U: PartialEq<T>,
source§impl<T, U, const N: usize> PartialEq<NonEmpty<Vec<T>>> for [U; N]where
U: PartialEq<T>,
impl<T, U, const N: usize> PartialEq<NonEmpty<Vec<T>>> for [U; N]where
U: PartialEq<T>,
source§impl<T, U> PartialEq<NonEmpty<Vec<T>>> for Vec<U>where
U: PartialEq<T>,
impl<T, U> PartialEq<NonEmpty<Vec<T>>> for Vec<U>where
U: PartialEq<T>,
source§impl<T, U> PartialEq<NonEmpty<Vec<U>>> for &Slice<T>where
T: PartialEq<U>,
impl<T, U> PartialEq<NonEmpty<Vec<U>>> for &Slice<T>where
T: PartialEq<U>,
source§impl<T, U> PartialEq<NonEmpty<Vec<U>>> for &mut Slice<T>where
T: PartialEq<U>,
impl<T, U> PartialEq<NonEmpty<Vec<U>>> for &mut Slice<T>where
T: PartialEq<U>,
source§impl<T, U> PartialEq<NonEmpty<Vec<U>>> for Cow<'_, Slice<T>>
impl<T, U> PartialEq<NonEmpty<Vec<U>>> for Cow<'_, Slice<T>>
source§impl<T, U> PartialEq<NonEmpty<Vec<U>>> for Slice<T>where
T: PartialEq<U>,
impl<T, U> PartialEq<NonEmpty<Vec<U>>> for Slice<T>where
T: PartialEq<U>,
source§impl<T, U> PartialEq<NonEmpty<Vec<U>>> for Vec<T>where
T: PartialEq<U>,
impl<T, U> PartialEq<NonEmpty<Vec<U>>> for Vec<T>where
T: PartialEq<U>,
source§impl<T> PartialOrd<NonEmpty<[T]>> for [T]where
T: PartialOrd,
impl<T> PartialOrd<NonEmpty<[T]>> for [T]where
T: PartialOrd,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<T, const N: usize> PartialOrd<NonEmpty<[T]>> for [T; N]where
T: PartialOrd,
impl<T, const N: usize> PartialOrd<NonEmpty<[T]>> for [T; N]where
T: PartialOrd,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<T> PartialOrd<NonEmpty<[T]>> for Vec<T>where
T: PartialOrd,
impl<T> PartialOrd<NonEmpty<[T]>> for Vec<T>where
T: PartialOrd,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<T, const N: usize> PartialOrd<NonEmpty<[T; N]>> for [T]where
T: PartialOrd,
impl<T, const N: usize> PartialOrd<NonEmpty<[T; N]>> for [T]where
T: PartialOrd,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<T, const N: usize> PartialOrd<NonEmpty<[T; N]>> for [T; N]where
T: PartialOrd,
impl<T, const N: usize> PartialOrd<NonEmpty<[T; N]>> for [T; N]where
T: PartialOrd,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<T, const N: usize> PartialOrd<NonEmpty<[T; N]>> for Vec<T>where
T: PartialOrd,
impl<T, const N: usize> PartialOrd<NonEmpty<[T; N]>> for Vec<T>where
T: PartialOrd,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<T> PartialOrd<NonEmpty<Vec<T>>> for [T]where
T: PartialOrd,
impl<T> PartialOrd<NonEmpty<Vec<T>>> for [T]where
T: PartialOrd,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<T, const N: usize> PartialOrd<NonEmpty<Vec<T>>> for [T; N]where
T: PartialOrd,
impl<T, const N: usize> PartialOrd<NonEmpty<Vec<T>>> for [T; N]where
T: PartialOrd,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<T> PartialOrd<NonEmpty<Vec<T>>> for Vec<T>where
T: PartialOrd,
impl<T> PartialOrd<NonEmpty<Vec<T>>> for Vec<T>where
T: PartialOrd,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl<T: Copy + ?Sized> Copy for NonEmpty<T>
impl<T> Eq for NonEmpty<[T]>where
T: Eq,
impl<T, const N: usize> Eq for NonEmpty<[T; N]>where
T: Eq,
impl<T> Eq for NonEmpty<Vec<T>>where
T: Eq,
Auto Trait Implementations§
impl<T> Freeze for NonEmpty<T>
impl<T> RefUnwindSafe for NonEmpty<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Send for NonEmpty<T>
impl<T> Sync for NonEmpty<T>
impl<T> Unpin for NonEmpty<T>
impl<T> UnwindSafe for NonEmpty<T>where
T: UnwindSafe + ?Sized,
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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)