Struct nunny::NonEmpty

source ·
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]>

Array methods

source

pub const fn new_ref(src: &[T; N]) -> Option<&Self>

Returns a NonEmpty array.

Returns None if src is empty.

source

pub fn new_mut(src: &mut [T; N]) -> Option<&mut Self>

Returns a NonEmpty array.

Returns None if src is empty.

source

pub fn new(src: [T; N]) -> Option<Self>

Returns a NonEmpty array.

Returns None if src is empty.

source

pub const unsafe fn new_ref_unchecked(src: &[T; N]) -> &Self

Create a NonEmpty array.

§Safety
  • src must not be empty
source

pub unsafe fn new_mut_unchecked(src: &mut [T; N]) -> &mut Self

Create a NonEmpty array.

§Safety
  • src must not be empty
source

pub const unsafe fn new_unchecked(src: [T; N]) -> Self

Create a NonEmpty array.

§Safety
  • src must not be empty
source

pub fn each_ref(&self) -> Array<&T, N>

Borrows each element and returns a NonEmpty array of references with the same size as self.

source

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.

source

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.

source

pub const fn as_slice_ne(&self) -> &Slice<T>

Returns a NonEmpty slice.

source

pub fn as_mut_slice_ne(&mut self) -> &mut Slice<T>

Returns a NonEmpty slice.

source

pub const fn as_array(&self) -> &[T; N]

Returns a primitive array.

source

pub fn as_mut_array(&mut self) -> &mut [T; N]

Returns a primitive array.

source

pub fn into_array(self) -> [T; N]

Returns a primitive array.

source§

impl<T, const N: usize> NonEmpty<[T; N]>

Known non-empty iterator for Array.

source

pub fn into_iter_ne(self) -> NonEmpty<IntoIter<T, N>>

source§

impl<T> NonEmpty<[T; 1]>

Special case for Arrays of length one

source

pub const fn of(item: T) -> Self

Create a NonEmpty array of a single element

source

pub fn of_mut(item: &mut T) -> &mut Self

Create a NonEmpty array of a single mutable reference

source

pub const fn of_ref(item: &T) -> &Self

Create a NonEmpty array of a single reference

source§

impl<I> NonEmpty<I>
where I: Iterator,

Methods on Iterators with a non-empty invariant.

See Self::relax to access the normal iterator inside.

source

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
source

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
source

pub fn map<B, F>(self, f: F) -> NonEmpty<Map<I, F>>
where F: FnMut(I::Item) -> B,

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
);
source

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
);
source

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')
);
source

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']
);
source

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'
)
source

pub fn flatten<II, T>(self) -> NonEmpty<FlatMap<I, II, fn(_: I::Item) -> II>>
where I: Iterator<Item = NonEmpty<II>>, II: IntoIterator<Item = T>,

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],
);
source

pub fn fuse(self) -> NonEmpty<Fuse<I>>

source

pub fn inspect<F>(self, f: F) -> NonEmpty<Inspect<I, F>>
where F: FnMut(&I::Item),

source

pub fn reduce<F>(self, f: F) -> I::Item
where F: FnMut(I::Item, I::Item) -> 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
source

pub fn max(self) -> I::Item
where I::Item: Ord,

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
source

pub fn min(self) -> I::Item
where I::Item: Ord,

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
source

pub fn max_by_key<B, F>(self, f: F) -> I::Item
where B: Ord, F: FnMut(&I::Item) -> B,

source

pub fn max_by<F>(self, compare: F) -> I::Item
where F: FnMut(&I::Item, &I::Item) -> Ordering,

source

pub fn min_by_key<B, F>(self, f: F) -> I::Item
where B: Ord, F: FnMut(&I::Item) -> B,

source

pub fn min_by<F>(self, compare: F) -> I::Item
where F: FnMut(&I::Item, &I::Item) -> Ordering,

source

pub fn rev(self) -> NonEmpty<Rev<I>>

NonEmpty version of Iterator::rev.

source

pub fn unzip_vec<A, B>(self) -> (Vec<A>, Vec<B>)
where I: Iterator<Item = (A, B)>,

source

pub fn copied<'a, T>(self) -> NonEmpty<Copied<I>>
where T: 'a + Copy, I: Iterator<Item = &'a T>,

source

pub fn cloned<'a, T>(self) -> NonEmpty<Cloned<I>>
where T: 'a + Clone, I: Iterator<Item = &'a T>,

source

pub fn cycle(self) -> NonEmpty<Cycle<I>>
where I: Clone,

source

pub fn relax(self) -> I

Remove the NonEmpty wrapper, allowing you to access normal iterator methods like Iterator::filter.

source

pub fn collect_vec(self) -> Vec<I::Item>

Collect this iterator into a NonEmpty<Vec>.

source

pub fn try_collect_vec<T, E>(self) -> Result<Vec<T>, E>
where I: Iterator<Item = Result<T, E>>,

Collect Ok items into a NonEmpty<Vec>, short-circuiting on Err.

source§

impl<I> NonEmpty<Peekable<I>>
where I: Iterator,

source

pub fn peek(&mut self) -> &I::Item

Peek this NonEmpty iterator, without advancing it.

See Self::peekable.

source

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]>

Slice methods

source

pub const fn new(src: &[T]) -> Option<&Self>

Create a new NonEmpty slice

Returns None if src is empty.

source

pub fn new_mut(src: &mut [T]) -> Option<&mut Self>

Create a new NonEmpty slice

Returns None if src is empty.

source

pub const unsafe fn new_unchecked(src: &[T]) -> &Self

Create a new NonEmpty slice

§Safety
  • src must not be empty
source

pub unsafe fn new_mut_unchecked(src: &mut [T]) -> &mut Self

Create a new NonEmpty slice

§Safety
  • src must not be empty
source

pub const fn of(item: &T) -> &Self

Create a NonEmpty slice of a single element

source

pub fn of_mut(item: &mut T) -> &mut Self

Create a NonEmpty slice of a single element

source

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

Returns a primitive slice.

source

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

Returns a primitive slice.

source

pub const fn len_ne(&self) -> NonZeroUsize

Returns the known non-zero length.

source

pub const fn first(&self) -> &T

Returns the first element, guaranteed.

source

pub const fn split_first(&self) -> (&T, &[T])

Returns the first element, guaranteed, and the rest of the elements.

source

pub const fn split_last(&self) -> (&T, &[T])

Returns the last element, guaranteed, and the rest of the elements.

source

pub const fn last(&self) -> &T

Returns the last element, guaranteed.

source

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

Returns the first element, guaranteed.

source

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

Returns the first element, guaranteed, and the rest of the elements.

source

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

Returns the last element, guaranteed, and the rest of the elements.

source

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

Returns the last element, guaranteed.

source§

impl<T> NonEmpty<[T]>

Known non-empty iterators for Slice.

source

pub fn iter_ne(&self) -> NonEmpty<Iter<'_, T>>

source

pub fn iter_mut_ne(&mut self) -> NonEmpty<IterMut<'_, T>>

source

pub fn into_iter_ne(self: Box<Self>) -> NonEmpty<IntoIter<T>>

source§

impl<T> NonEmpty<Vec<T>>

Vec methods

source

pub fn new_ref(src: &Vec<T>) -> Option<&Self>

Create a new NonEmpty heap-allocated vec

Returns None if src is empty.

source

pub fn new_mut(src: &mut Vec<T>) -> Option<&mut Self>

Create a new NonEmpty heap-allocated vec

Returns None if src is empty.

source

pub unsafe fn new_unchecked(src: Vec<T>) -> Self

Create a new NonEmpty heap-allocated vec

§Safety
  • src must not be empty
source

pub unsafe fn new_ref_unchecked(src: &Vec<T>) -> &Self

Create a new NonEmpty heap-allocated vec

§Safety
  • src must not be empty
source

pub unsafe fn new_mut_unchecked(src: &mut Vec<T>) -> &mut Self

Create a new NonEmpty heap-allocated vec

§Safety
  • src must not be empty
source

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.

source

pub fn of(item: T) -> Self

Create a NonEmpty heap-allocated vec, of a single element.

source

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.

source

pub fn of_extending<A>(first: T, rest: impl IntoIterator<Item = A>) -> Self
where 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"]);
source

pub fn filled(value: T, len: NonZeroUsize) -> Self
where T: Clone,

Create a NonEmpty heap-allocated vec with len items, filled with Clones of the given value.

See also Self::filled_with.

source

pub fn filled_with<F>(f: F, len: NonZeroUsize) -> Self
where 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.

source

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

Returns a std::vec::Vec.

source

pub unsafe fn as_mut_vec(&mut self) -> &mut Vec<T>

Returns a std::vec::Vec.

§Safety
  • returned vec must not be emptied through this reference
source

pub fn into_vec(self) -> Vec<T>

Returns a std::vec::Vec.

source

pub fn as_slice_ne(&self) -> &Slice<T>

Returns a NonEmpty slice.

source

pub fn as_mut_slice_ne(&mut self) -> &mut Slice<T>

Returns a NonEmpty slice.

source

pub fn capacity(&self) -> NonZeroUsize

Returns the known non-zero length.

source

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

See reserve.

source

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

source

pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>

source

pub fn try_reserve_exact( &mut self, additional: usize, ) -> Result<(), TryReserveError>

source

pub fn shrink_to_fit(&mut self)

source

pub fn shrink_to(&mut self, min_capacity: usize)

See shrink_to.

source

pub fn into_boxed_slice(self) -> Box<Slice<T>>

Return a NonEmpty boxed slice.

source

pub fn truncate(&mut self, len: NonZeroUsize)

Shortens the vector to a guaranteed-nonzero length

See truncate.

source

pub unsafe fn set_len(&mut self, new_len: NonZeroUsize)

§Safety
source

pub fn insert(&mut self, index: usize, element: T)

See insert.

source

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

source

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

See dedup_by.

source

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

See push.

source

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

See append.

source

pub fn resize_with<F>(&mut self, new_len: NonZeroUsize, f: F)
where F: FnMut() -> T,

source

pub fn leak<'a>(self) -> &'a mut Slice<T>

Returns a NonEmpty slice.

See leak.

source

pub fn spare_capacity_mut(&mut self) -> &mut [MaybeUninit<T>]

source§

impl<T> NonEmpty<Vec<T>>

Known non-empty iterator for Vec.

Trait Implementations§

source§

impl<T> AsMut<NonEmpty<[T]>> for Slice<T>

source§

fn as_mut(&mut self) -> &mut Self

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T, const N: usize> AsMut<NonEmpty<[T]>> for Array<T, N>

source§

fn as_mut(&mut self) -> &mut Slice<T>

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsMut<NonEmpty<[T]>> for Vec<T>

source§

fn as_mut(&mut self) -> &mut Slice<T>

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T, const N: usize> AsMut<NonEmpty<[T; N]>> for Array<T, N>

source§

fn as_mut(&mut self) -> &mut Self

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsMut<NonEmpty<Vec<T>>> for Vec<T>

source§

fn as_mut(&mut self) -> &mut Self

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsRef<NonEmpty<[T]>> for Slice<T>

source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T, const N: usize> AsRef<NonEmpty<[T]>> for Array<T, N>

source§

fn as_ref(&self) -> &Slice<T>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> AsRef<NonEmpty<[T]>> for Vec<T>

source§

fn as_ref(&self) -> &Slice<T>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T, const N: usize> AsRef<NonEmpty<[T; N]>> for Array<T, N>

source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> AsRef<NonEmpty<Vec<T>>> for Vec<T>

source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T, const N: usize> Borrow<NonEmpty<[T]>> for Array<T, N>

source§

fn borrow(&self) -> &Slice<T>

Immutably borrows from an owned value. Read more
source§

impl<T> Borrow<NonEmpty<[T]>> for Vec<T>

source§

fn borrow(&self) -> &Slice<T>

Immutably borrows from an owned value. Read more
source§

impl<T, const N: usize> BorrowMut<NonEmpty<[T]>> for Array<T, N>

source§

fn borrow_mut(&mut self) -> &mut Slice<T>

Mutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<NonEmpty<[T]>> for Vec<T>

source§

fn borrow_mut(&mut self) -> &mut Slice<T>

Mutably borrows from an owned value. Read more
source§

impl<T: Clone + ?Sized> Clone for NonEmpty<T>

source§

fn clone(&self) -> NonEmpty<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug + ?Sized> Debug for NonEmpty<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, T> From<&'a NonEmpty<[T]>> for &'a [T]

source§

fn from(value: &'a Slice<T>) -> Self

Converts to this type from the input type.
source§

impl<T> From<&NonEmpty<[T]>> for Arc<Slice<T>>
where T: Clone,

source§

fn from(value: &Slice<T>) -> Self

Converts to this type from the input type.
source§

impl<T> From<&NonEmpty<[T]>> for Box<Slice<T>>
where T: Clone,

source§

fn from(value: &Slice<T>) -> Self

Converts to this type from the input type.
source§

impl<'a, T> From<&'a NonEmpty<[T]>> for Cow<'a, Slice<T>>
where T: Clone,

source§

fn from(value: &'a Slice<T>) -> Self

Converts to this type from the input type.
source§

impl<T> From<&NonEmpty<[T]>> for Vec<T>
where T: Clone,

source§

fn from(value: &Slice<T>) -> Self

Converts to this type from the input type.
source§

impl<T> From<&NonEmpty<[T]>> for Rc<Slice<T>>
where T: Clone,

source§

fn from(value: &Slice<T>) -> Self

Converts to this type from the input type.
source§

impl<'a, T, const N: usize> From<&'a NonEmpty<[T; N]>> for &'a [T; N]

source§

fn from(value: &'a Array<T, N>) -> Self

Converts to this type from the input type.
source§

impl<'a, const N: usize, T> From<&'a NonEmpty<[T; N]>> for Cow<'a, Slice<T>>
where T: Clone,

source§

fn from(value: &'a Array<T, N>) -> Self

Converts to this type from the input type.
source§

impl<const N: usize, T> From<&NonEmpty<[T; N]>> for Vec<T>
where T: Clone,

source§

fn from(value: &Array<T, N>) -> Self

Converts to this type from the input type.
source§

impl<'a, T> From<&'a NonEmpty<Vec<T>>> for &'a Vec<T>

source§

fn from(value: &'a Vec<T>) -> Self

Converts to this type from the input type.
source§

impl<'a, T> From<&'a NonEmpty<Vec<T>>> for Cow<'a, Slice<T>>
where T: Clone,

source§

fn from(value: &'a Vec<T>) -> Self

Converts to this type from the input type.
source§

impl<'a, T> From<&'a mut NonEmpty<[T]>> for &'a mut [T]

source§

fn from(value: &'a mut Slice<T>) -> Self

Converts to this type from the input type.
source§

impl<T> From<&mut NonEmpty<[T]>> for Vec<T>
where T: Clone,

source§

fn from(value: &mut Slice<T>) -> Self

Converts to this type from the input type.
source§

impl<'a, T, const N: usize> From<&'a mut NonEmpty<[T; N]>> for &'a mut [T; N]

source§

fn from(value: &'a mut Array<T, N>) -> Self

Converts to this type from the input type.
source§

impl<const N: usize, T> From<&mut NonEmpty<[T; N]>> for Vec<T>
where T: Clone,

source§

fn from(value: &mut Array<T, N>) -> Self

Converts to this type from the input type.
source§

impl<const N: usize, K, V> From<NonEmpty<[(K, V); N]>> for BTreeMap<K, V>
where K: Ord,

source§

fn from(value: Array<(K, V), N>) -> Self

Converts to this type from the input type.
source§

impl<const N: usize, K, V> From<NonEmpty<[(K, V); N]>> for HashMap<K, V, RandomState>
where K: Eq + Hash,

source§

fn from(value: Array<(K, V), N>) -> Self

Converts to this type from the input type.
source§

impl<T, const N: usize> From<NonEmpty<[T; N]>> for [T; N]

source§

fn from(value: Array<T, N>) -> Self

Converts to this type from the input type.
source§

impl<const N: usize, T> From<NonEmpty<[T; N]>> for Arc<Slice<T>>

source§

fn from(value: Array<T, N>) -> Self

Converts to this type from the input type.
source§

impl<const N: usize, T> From<NonEmpty<[T; N]>> for BTreeSet<T>
where T: Ord,

source§

fn from(value: Array<T, N>) -> Self

Converts to this type from the input type.
source§

impl<const N: usize, T> From<NonEmpty<[T; N]>> for BinaryHeap<T>
where T: Ord,

source§

fn from(value: Array<T, N>) -> Self

Converts to this type from the input type.
source§

impl<const N: usize, T> From<NonEmpty<[T; N]>> for Box<Slice<T>>

source§

fn from(value: Array<T, N>) -> Self

Converts to this type from the input type.
source§

impl<const N: usize, T> From<NonEmpty<[T; N]>> for HashSet<T, RandomState>
where T: Eq + Hash,

source§

fn from(value: Array<T, N>) -> Self

Converts to this type from the input type.
source§

impl<const N: usize, T> From<NonEmpty<[T; N]>> for LinkedList<T>

source§

fn from(value: Array<T, N>) -> Self

Converts to this type from the input type.
source§

impl<const N: usize, T> From<NonEmpty<[T; N]>> for Vec<T>

source§

fn from(value: Array<T, N>) -> Self

Converts to this type from the input type.
source§

impl<const N: usize, T> From<NonEmpty<[T; N]>> for Rc<Slice<T>>

source§

fn from(value: Array<T, N>) -> Self

Converts to this type from the input type.
source§

impl<const N: usize, T> From<NonEmpty<[T; N]>> for VecDeque<T>

source§

fn from(value: Array<T, N>) -> Self

Converts to this type from the input type.
source§

impl<T> From<NonEmpty<Vec<T>>> for Arc<Slice<T>>

source§

fn from(value: Vec<T>) -> Self

Converts to this type from the input type.
source§

impl<T> From<NonEmpty<Vec<T>>> for Box<Slice<T>>

source§

fn from(value: Vec<T>) -> Self

Converts to this type from the input type.
source§

impl<'a, T> From<NonEmpty<Vec<T>>> for Cow<'a, Slice<T>>
where T: Clone,

source§

fn from(value: Vec<T>) -> Self

Converts to this type from the input type.
source§

impl<T> From<NonEmpty<Vec<T>>> for Rc<Slice<T>>

source§

fn from(value: Vec<T>) -> Self

Converts to this type from the input type.
source§

impl<T> From<NonEmpty<Vec<T>>> for Vec<T>

source§

fn from(value: Vec<T>) -> Self

Converts to this type from the input type.
source§

impl<T: Hash + ?Sized> Hash for NonEmpty<T>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
source§

impl<A, B, const N: usize> PartialEq<&NonEmpty<[B]>> for Array<A, N>
where A: PartialEq<B>,

source§

fn eq(&self, other: &&Slice<B>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U> PartialEq<&NonEmpty<[U]>> for Cow<'_, Slice<T>>
where T: PartialEq<U> + Clone,

source§

fn eq(&self, other: &&Slice<U>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U> PartialEq<&NonEmpty<[U]>> for Vec<T>
where T: PartialEq<U>,

source§

fn eq(&self, other: &&Slice<U>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U> PartialEq<&NonEmpty<[U]>> for VecDeque<T>
where T: PartialEq<U>,

source§

fn eq(&self, other: &&Slice<U>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U, const N: usize> PartialEq<&NonEmpty<[U; N]>> for Vec<T>
where T: PartialEq<U>,

source§

fn eq(&self, other: &&Array<U, N>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U, const N: usize> PartialEq<&NonEmpty<[U; N]>> for VecDeque<T>
where T: PartialEq<U>,

source§

fn eq(&self, other: &&Array<U, N>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize> PartialEq<&mut NonEmpty<[B]>> for Array<A, N>
where A: PartialEq<B>,

source§

fn eq(&self, other: &&mut Slice<B>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U> PartialEq<&mut NonEmpty<[U]>> for Cow<'_, Slice<T>>
where T: PartialEq<U> + Clone,

source§

fn eq(&self, other: &&mut Slice<U>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U> PartialEq<&mut NonEmpty<[U]>> for Vec<T>
where T: PartialEq<U>,

source§

fn eq(&self, other: &&mut Slice<U>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U> PartialEq<&mut NonEmpty<[U]>> for VecDeque<T>
where T: PartialEq<U>,

source§

fn eq(&self, other: &&mut Slice<U>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U, const N: usize> PartialEq<&mut NonEmpty<[U; N]>> for VecDeque<T>
where T: PartialEq<U>,

source§

fn eq(&self, other: &&mut Array<U, N>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize> PartialEq<NonEmpty<[A; N]>> for &Slice<B>
where B: PartialEq<A>,

source§

fn eq(&self, other: &Array<A, N>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize> PartialEq<NonEmpty<[A; N]>> for &mut Slice<B>
where B: PartialEq<A>,

source§

fn eq(&self, other: &Array<A, N>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize> PartialEq<NonEmpty<[A; N]>> for Slice<B>
where B: PartialEq<A>,

source§

fn eq(&self, other: &Array<A, N>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<A, B> PartialEq<NonEmpty<[B]>> for Slice<A>
where A: PartialEq<B>,

source§

fn eq(&self, other: &Slice<B>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize> PartialEq<NonEmpty<[B]>> for Array<A, N>
where A: PartialEq<B>,

source§

fn eq(&self, other: &Slice<B>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<A, B, const N: usize> PartialEq<NonEmpty<[B; N]>> for Array<A, N>
where A: PartialEq<B>,

source§

fn eq(&self, other: &Array<B, N>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U> PartialEq<NonEmpty<[T]>> for [U]
where U: PartialEq<T>,

source§

fn eq(&self, other: &Slice<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U, const N: usize> PartialEq<NonEmpty<[T]>> for [U; N]
where U: PartialEq<T>,

source§

fn eq(&self, other: &Slice<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U> PartialEq<NonEmpty<[T]>> for Vec<U>
where U: PartialEq<T>,

source§

fn eq(&self, other: &Slice<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U, const N: usize> PartialEq<NonEmpty<[T; N]>> for [U]
where U: PartialEq<T>,

source§

fn eq(&self, other: &Array<T, N>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U, const N: usize> PartialEq<NonEmpty<[T; N]>> for [U; N]
where U: PartialEq<T>,

source§

fn eq(&self, other: &Array<T, N>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U, const N: usize> PartialEq<NonEmpty<[T; N]>> for Vec<U>
where U: PartialEq<T>,

source§

fn eq(&self, other: &Array<T, N>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U> PartialEq<NonEmpty<[U]>> for Vec<T>
where T: PartialEq<U>,

source§

fn eq(&self, other: &Slice<U>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U, const N: usize> PartialEq<NonEmpty<[U; N]>> for Vec<T>
where T: PartialEq<U>,

source§

fn eq(&self, other: &Array<U, N>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U, const N: usize> PartialEq<NonEmpty<[U; N]>> for VecDeque<T>
where T: PartialEq<U>,

source§

fn eq(&self, other: &Array<U, N>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U> PartialEq<NonEmpty<Vec<T>>> for [U]
where U: PartialEq<T>,

source§

fn eq(&self, other: &Vec<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U, const N: usize> PartialEq<NonEmpty<Vec<T>>> for [U; N]
where U: PartialEq<T>,

source§

fn eq(&self, other: &Vec<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U> PartialEq<NonEmpty<Vec<T>>> for Vec<U>
where U: PartialEq<T>,

source§

fn eq(&self, other: &Vec<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U> PartialEq<NonEmpty<Vec<U>>> for &Slice<T>
where T: PartialEq<U>,

source§

fn eq(&self, other: &Vec<U>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U> PartialEq<NonEmpty<Vec<U>>> for &mut Slice<T>
where T: PartialEq<U>,

source§

fn eq(&self, other: &Vec<U>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U> PartialEq<NonEmpty<Vec<U>>> for Cow<'_, Slice<T>>
where T: PartialEq<U> + Clone,

source§

fn eq(&self, other: &Vec<U>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U> PartialEq<NonEmpty<Vec<U>>> for Slice<T>
where T: PartialEq<U>,

source§

fn eq(&self, other: &Vec<U>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U> PartialEq<NonEmpty<Vec<U>>> for Vec<T>
where T: PartialEq<U>,

source§

fn eq(&self, other: &Vec<U>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialOrd<NonEmpty<[T]>> for [T]
where T: PartialOrd,

source§

fn partial_cmp(&self, other: &Slice<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<T, const N: usize> PartialOrd<NonEmpty<[T]>> for [T; N]
where T: PartialOrd,

source§

fn partial_cmp(&self, other: &Slice<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<T> PartialOrd<NonEmpty<[T]>> for Vec<T>
where T: PartialOrd,

source§

fn partial_cmp(&self, other: &Slice<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<T, const N: usize> PartialOrd<NonEmpty<[T; N]>> for [T]
where T: PartialOrd,

source§

fn partial_cmp(&self, other: &Array<T, N>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<T, const N: usize> PartialOrd<NonEmpty<[T; N]>> for [T; N]
where T: PartialOrd,

source§

fn partial_cmp(&self, other: &Array<T, N>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<T, const N: usize> PartialOrd<NonEmpty<[T; N]>> for Vec<T>
where T: PartialOrd,

source§

fn partial_cmp(&self, other: &Array<T, N>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<T> PartialOrd<NonEmpty<Vec<T>>> for [T]
where T: PartialOrd,

source§

fn partial_cmp(&self, other: &Vec<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<T, const N: usize> PartialOrd<NonEmpty<Vec<T>>> for [T; N]
where T: PartialOrd,

source§

fn partial_cmp(&self, other: &Vec<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<T> PartialOrd<NonEmpty<Vec<T>>> for Vec<T>
where T: PartialOrd,

source§

fn partial_cmp(&self, other: &Vec<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<'a, T, const N: usize> TryFrom<&'a NonEmpty<[T]>> for &'a Array<T, N>

§

type Error = TryFromSliceError

The type returned in the event of a conversion error.
source§

fn try_from(value: &'a Slice<T>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<T, const N: usize> TryFrom<&NonEmpty<[T]>> for Array<T, N>
where T: Copy,

§

type Error = TryFromSliceError

The type returned in the event of a conversion error.
source§

fn try_from(value: &Slice<T>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a, T, const N: usize> TryFrom<&'a mut NonEmpty<[T]>> for &'a mut Array<T, N>

§

type Error = TryFromSliceError

The type returned in the event of a conversion error.
source§

fn try_from(value: &'a mut Slice<T>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<T, const N: usize> TryFrom<&mut NonEmpty<[T]>> for Array<T, N>
where T: Copy,

§

type Error = TryFromSliceError

The type returned in the event of a conversion error.
source§

fn try_from(value: &mut Slice<T>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<T, const N: usize> TryFrom<NonEmpty<Vec<T>>> for Box<Array<T, N>>

§

type Error = NonEmpty<Vec<T>>

The type returned in the event of a conversion error.
source§

fn try_from(value: Vec<T>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<T, const N: usize> TryFrom<NonEmpty<Vec<T>>> for Array<T, N>

§

type Error = NonEmpty<Vec<T>>

The type returned in the event of a conversion error.
source§

fn try_from(value: Vec<T>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<T: Copy + ?Sized> Copy for NonEmpty<T>

source§

impl<T> Eq for NonEmpty<[T]>
where T: Eq,

source§

impl<T, const N: usize> Eq for NonEmpty<[T; N]>
where T: Eq,

source§

impl<T> Eq for NonEmpty<Vec<T>>
where T: Eq,

Auto Trait Implementations§

§

impl<T> Freeze for NonEmpty<T>
where T: Freeze + ?Sized,

§

impl<T> RefUnwindSafe for NonEmpty<T>
where T: RefUnwindSafe + ?Sized,

§

impl<T> Send for NonEmpty<T>
where T: Send + ?Sized,

§

impl<T> Sync for NonEmpty<T>
where T: Sync + ?Sized,

§

impl<T> Unpin for NonEmpty<T>
where T: Unpin + ?Sized,

§

impl<T> UnwindSafe for NonEmpty<T>
where T: UnwindSafe + ?Sized,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

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

source§

impl<T> NumBytes for T
where T: Debug + AsRef<[u8]> + AsMut<[u8]> + PartialEq + Eq + PartialOrd + Ord + Hash + Borrow<[u8]> + BorrowMut<[u8]> + ?Sized,