Struct Vec

Source
pub struct Vec<N, A>
where N: Unsigned,
{ /* private fields */ }
Expand description

A vector of length N containing elements of type A.

Implementations§

Source§

impl<A> Vec<U0, A>

Source

pub fn new() -> Self

Construct an empty vector.

Source§

impl<N, A> Vec<N, A>
where N: Unsigned,

Source

pub fn fill<F>(f: F) -> Vec<N, A>
where F: FnMut(usize) -> A,

Construct a vector of size N using a function.

The function is called with an index to generate a value of A for each index in the vector.

§Examples
let vec: Vec<U3, _> = Vec::fill(|i| i + 10);
assert_eq!(svec![10, 11, 12], vec);
Source

pub fn repeat(a: A) -> Vec<N, A>
where A: Clone,

Construct a vector of size N containing the same element repeated.

§Examples
let vec: Vec<U3, _> = Vec::repeat(5);
assert_eq!(svec![5, 5, 5], vec);
Source

pub fn try_from_iter<I>(iter: I) -> Option<Self>
where I: IntoIterator<Item = A>,

Construct a vector of size N from an iterator.

Returns None if the iterator didn’t contain exactly N elements.

§Examples
let good_vec: Option<Vec<U3, _>> = Vec::try_from_iter(1..=3);
assert_eq!(Some(svec![1, 2, 3]), good_vec);

let bad_vec: Option<Vec<U3, _>> = Vec::try_from_iter(1..=500);
assert_eq!(None, bad_vec);
Source

pub fn from_default() -> Vec<N, A>
where A: Default,

Construct a vector of size N using the default value.

§Examples
let vec: Vec<U3, _> = Vec::from_default();
assert_eq!(svec![0, 0, 0], vec);
Source

pub fn push(self, a: A) -> Vec<Add1<N>, A>
where N: Add<B1>, Add1<N>: Unsigned,

Push an element onto the end of the vector.

§Examples
let vec: Vec<U2, _> = svec![1, 2];
let new_vec: Vec<U3, _> = vec.push(3);
assert_eq!(svec![1, 2, 3], new_vec);
let vec: Vec<U2, _> = svec![1, 2];
// Type error, because the new length will be U3, not U2:
let new_vec: Vec<U2, _> = vec.push(3);
Source

pub fn pop(self) -> (Vec<Diff<N, U1>, A>, A)
where N: Sub<U1>, Diff<N, U1>: Unsigned,

Pop an element off the end of the vector.

§Examples
let vec = svec![1, 2, 3];
let (new_vec, value) = vec.pop();
assert_eq!(svec![1, 2], new_vec);
assert_eq!(3, value);
let vec: Vec<U3, _> = svec![1, 2, 3];
// Type error, because the new length will be U2, not U3:
let (new_vec: Vec<U3, _>, value) = vec.pop();
Source

pub fn insert<Index>(self, _: Index, a: A) -> Vec<Add1<N>, A>
where Index: Unsigned + IsLess<N>, Le<Index, N>: IsTrue, N: Add<B1>, Add1<N>: Unsigned,

Insert an element into the vector at index Index.

Source

pub fn remove<Index>(self, _: Index) -> (Vec<Sub1<N>, A>, A)
where Index: Unsigned + IsLess<N>, Le<Index, N>: IsTrue, N: Sub<B1>, Sub1<N>: Unsigned,

Remove the element at index Index from the vector.

Source

pub fn swap_remove<Index>(self, _: Index) -> (Vec<Sub1<N>, A>, A)
where Index: Unsigned + IsLess<N>, Le<Index, N>: IsTrue, N: Sub<B1>, Sub1<N>: Unsigned,

Remove the element at index Index from the vector, replacing it with the element at the end of the vector.

Source

pub fn append<M>(self, other: Vec<M, A>) -> Vec<Sum<N, M>, A>
where N: Add<M>, M: Unsigned, Sum<N, M>: Unsigned,

Append two vectors together.

Source

pub fn get<Index>(&self, _: Index) -> &A
where Index: Unsigned + IsLess<N>, Le<Index, N>: IsTrue,

Get a reference to the element at index Index.

§Examples
let vec = svec![1, 2, 3];
assert_eq!(&2, vec.get(U1::new()));
let vec = svec![1, 2, 3];
// This index is out of bounds, so this won't compile:
assert_eq!(&2, vec.get(U5::new()));
Source

pub fn get_mut<Index>(&mut self, _: Index) -> &mut A
where Index: Unsigned + IsLess<N>, Le<Index, N>: IsTrue,

Get a mutable reference to the element at index Index.

Source

pub fn len(&self) -> usize

Get the length of the vector.

Source

pub fn is_empty(&self) -> bool
where N: IsEqual<U0>,

Test if the vector is empty.

Source

pub fn iter(&self) -> Iter<'_, A>

Get an iterator over the elements of the vector.

Source

pub fn iter_mut(&mut self) -> IterMut<'_, A>

Get a mutable iterator over the elements of the vector.

Source

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

Get a reference to the slice of elements contained in the vector.

Source

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

Get a mutable reference to the slice of elements contained in the vector.

Source

pub fn truncate<M>(self) -> Vec<M, A>
where M: Unsigned + IsLessOrEqual<N>, LeEq<M, N>: IsTrue,

Truncate the vector to fit the size given by the target type.

§Examples
let vec_6 = svec![1, 2, 3, 4, 5, 6];
let vec_3: Vec<U3, _> = vec_6.truncate();
assert_eq!(svec![1, 2, 3], vec_3);
Source

pub fn slice<Left, Right>( self, _: Range<Left, Right>, ) -> (Vec<Diff<N, Diff<Right, Left>>, A>, Vec<Diff<Right, Left>, A>)
where Diff<N, Diff<Right, Left>>: Unsigned, Diff<Right, Left>: Unsigned, Left: Unsigned + IsLessOrEqual<Right>, Right: Unsigned + Sub<Left> + IsLessOrEqual<N>, N: Sub<Diff<Right, Left>>, LeEq<Left, Right>: IsTrue, LeEq<Right, N>: IsTrue,

Slice a subset out of the vector.

§Examples
let vec = svec![1, 2, 3, 4, 5, 6];
let (vec, sub_vec) = vec.slice(Range::<U2, U4>::new());
assert_eq!(svec![1, 2, 5, 6], vec);
assert_eq!(svec![3, 4], sub_vec);
Source

pub fn drain<Left, Right>( self, range: Range<Left, Right>, ) -> (Vec<Diff<N, Diff<Right, Left>>, A>, impl Iterator<Item = A>)
where Diff<N, Diff<Right, Left>>: Unsigned, Diff<Right, Left>: Unsigned, Left: Unsigned + IsLessOrEqual<Right>, Right: Unsigned + Sub<Left> + IsLessOrEqual<N>, N: Sub<Diff<Right, Left>>, LeEq<Left, Right>: IsTrue, LeEq<Right, N>: IsTrue,

Remove a subset from the vector and return an iterator over the removed elements.

§Examples
let vec = svec![1, 2, 3, 4, 5, 6];
let (vec, iter) = vec.drain(Range::<U2, U4>::new());
assert_eq!(svec![1, 2, 5, 6], vec);
assert_eq!(vec![3, 4], iter.collect::<::std::vec::Vec<_>>());
Source

pub fn clear(self) -> Vec<U0, A>

Drop the contents of the vector, leaving an empty vector.

Source

pub fn split_off<Index>( self, _: Index, ) -> (Vec<Index, A>, Vec<Diff<N, Index>, A>)
where Index: Unsigned + IsLessOrEqual<N>, N: Sub<Index>, Diff<N, Index>: Unsigned, LeEq<Index, N>: IsTrue,

Split the vector at Index, returning the two sides of the split.

§Examples
let vec = svec![1, 2, 3, 4, 5, 6];
let (left, right) = vec.split_off(U3::new());
assert_eq!(svec![1, 2, 3], left);
assert_eq!(svec![4, 5, 6], right);
Source

pub fn resize<M>(self, value: A) -> Vec<M, A>
where M: Unsigned, A: Clone,

Resize the vector, dropping elements if the new size is smaller, and padding with copies of value if it is larger.

§Examples
let vec = svec![1, 2, 3];
let vec: Vec<U5, _> = vec.resize(100);
assert_eq!(svec![1, 2, 3, 100, 100], vec);
Source

pub fn map<F, B>(self, f: F) -> Vec<N, B>
where F: FnMut(A) -> B,

Map the vector into a vector of elements of B using a function.

§Examples
let vec = svec![1, 2, 3];
let vec = vec.map(|num| format!("{}", num));
assert_eq!(svec![
    "1".to_string(), "2".to_string(), "3".to_string()
], vec);
Source

pub fn apply<F, B>(self, fs: Vec<N, F>) -> Vec<N, B>
where F: FnMut(A) -> B,

Apply a list of functions from A to B to a vector of A in order, returning a vector of B.

§Examples
let vec = svec![1, 2, 3];
let fn_vec = vec.clone().map(|i| move |a| a + i);
let vec = vec.apply(fn_vec);
assert_eq!(svec![2, 4, 6], vec);
Source

pub fn zip<B, C, F>(self, other: Vec<N, B>, f: F) -> Vec<N, C>
where F: FnMut(A, B) -> C,

Merge two vectors together into a new vector using a function.

§Examples
let left = svec!["foo", "bar"];
let right = svec!["lol", "omg"];
let vec = left.zip(right, |a, b| format!("{} {}", a, b));
assert_eq!(svec![
    "foo lol".to_string(), "bar omg".to_string()
], vec);
Source

pub fn unzip<B, C, F>(self, f: F) -> (Vec<N, B>, Vec<N, C>)
where F: FnMut(A) -> (B, C),

Split a vector into two vectors of the same size using a function.

§Examples
let vec = svec![1, 2, 3];
let vec = vec.unzip(|a| (a, a * 2));
assert_eq!((svec![1, 2, 3], svec![2, 4, 6]), vec);

Trait Implementations§

Source§

impl<N, M, A> Add<Vec<M, A>> for Vec<N, A>
where N: Unsigned + Add<M>, M: Unsigned, Sum<N, M>: Unsigned,

Source§

type Output = Vec<<N as Add<M>>::Output, A>

The resulting type after applying the + operator.
Source§

fn add(self, other: Vec<M, A>) -> Self::Output

Performs the + operation. Read more
Source§

impl<N, A> AsMut<[A]> for Vec<N, A>
where N: Unsigned,

Source§

fn as_mut(&mut self) -> &mut [A]

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

impl<N, A> AsMut<Vec<N, A>> for Vec<N, A>
where N: Unsigned,

Source§

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

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

impl<N, A> AsRef<[A]> for Vec<N, A>
where N: Unsigned,

Source§

fn as_ref(&self) -> &[A]

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

impl<N, A> AsRef<Vec<A>> for Vec<N, A>
where N: Unsigned,

Source§

fn as_ref(&self) -> &Vec<A>

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

impl<N, A> AsRef<Vec<N, A>> for Vec<N, A>
where N: Unsigned,

Source§

fn as_ref(&self) -> &Self

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

impl<N, A> Borrow<[A]> for Vec<N, A>
where N: Unsigned,

Source§

fn borrow(&self) -> &[A]

Immutably borrows from an owned value. Read more
Source§

impl<N, A> Borrow<Vec<A>> for Vec<N, A>
where N: Unsigned,

Source§

fn borrow(&self) -> &Vec<A>

Immutably borrows from an owned value. Read more
Source§

impl<N, A> BorrowMut<[A]> for Vec<N, A>
where N: Unsigned,

Source§

fn borrow_mut(&mut self) -> &mut [A]

Mutably borrows from an owned value. Read more
Source§

impl<N, A: Clone> Clone for Vec<N, A>
where N: Unsigned + Clone,

Source§

fn clone(&self) -> Vec<N, A>

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<N, A> Debug for Vec<N, A>
where N: Unsigned, A: Debug,

Source§

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

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

impl<A> Default for Vec<U0, A>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<A> From<[A; 0]> for Vec<U0, A>

Source§

fn from(array: [A; 0]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 1]> for Vec<U1, A>

Source§

fn from(array: [A; 1]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 10]> for Vec<U10, A>

Source§

fn from(array: [A; 10]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 11]> for Vec<U11, A>

Source§

fn from(array: [A; 11]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 12]> for Vec<U12, A>

Source§

fn from(array: [A; 12]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 13]> for Vec<U13, A>

Source§

fn from(array: [A; 13]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 14]> for Vec<U14, A>

Source§

fn from(array: [A; 14]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 15]> for Vec<U15, A>

Source§

fn from(array: [A; 15]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 16]> for Vec<U16, A>

Source§

fn from(array: [A; 16]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 17]> for Vec<U17, A>

Source§

fn from(array: [A; 17]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 18]> for Vec<U18, A>

Source§

fn from(array: [A; 18]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 19]> for Vec<U19, A>

Source§

fn from(array: [A; 19]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 2]> for Vec<U2, A>

Source§

fn from(array: [A; 2]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 20]> for Vec<U20, A>

Source§

fn from(array: [A; 20]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 21]> for Vec<U21, A>

Source§

fn from(array: [A; 21]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 22]> for Vec<U22, A>

Source§

fn from(array: [A; 22]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 23]> for Vec<U23, A>

Source§

fn from(array: [A; 23]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 24]> for Vec<U24, A>

Source§

fn from(array: [A; 24]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 25]> for Vec<U25, A>

Source§

fn from(array: [A; 25]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 26]> for Vec<U26, A>

Source§

fn from(array: [A; 26]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 27]> for Vec<U27, A>

Source§

fn from(array: [A; 27]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 28]> for Vec<U28, A>

Source§

fn from(array: [A; 28]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 29]> for Vec<U29, A>

Source§

fn from(array: [A; 29]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 3]> for Vec<U3, A>

Source§

fn from(array: [A; 3]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 30]> for Vec<U30, A>

Source§

fn from(array: [A; 30]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 31]> for Vec<U31, A>

Source§

fn from(array: [A; 31]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 4]> for Vec<U4, A>

Source§

fn from(array: [A; 4]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 5]> for Vec<U5, A>

Source§

fn from(array: [A; 5]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 6]> for Vec<U6, A>

Source§

fn from(array: [A; 6]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 7]> for Vec<U7, A>

Source§

fn from(array: [A; 7]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 8]> for Vec<U8, A>

Source§

fn from(array: [A; 8]) -> Self

Converts to this type from the input type.
Source§

impl<A> From<[A; 9]> for Vec<U9, A>

Source§

fn from(array: [A; 9]) -> Self

Converts to this type from the input type.
Source§

impl<N, A: Hash> Hash for Vec<N, A>
where N: Unsigned + Hash,

Source§

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

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<N, A, I> Index<I> for Vec<N, A>
where N: Unsigned, I: Unsigned + IsLess<N>, Le<I, N>: IsTrue,

Source§

type Output = A

The returned type after indexing.
Source§

fn index(&self, index: I) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<N, A, I> IndexMut<I> for Vec<N, A>
where N: Unsigned, I: Unsigned + IsLess<N>, Le<I, N>: IsTrue,

Source§

fn index_mut(&mut self, index: I) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<'a, N, A> Into<&'a [A]> for &'a Vec<N, A>
where N: Unsigned,

Source§

fn into(self) -> &'a [A]

Converts this type into the (usually inferred) input type.
Source§

impl<'a, N, A> Into<&'a mut [A]> for &'a mut Vec<N, A>
where N: Unsigned,

Source§

fn into(self) -> &'a mut [A]

Converts this type into the (usually inferred) input type.
Source§

impl<N, A> Into<Vec<A>> for Vec<N, A>
where N: Unsigned,

Source§

fn into(self) -> Vec<A>

Converts this type into the (usually inferred) input type.
Source§

impl<'a, N, A> IntoIterator for &'a Vec<N, A>
where N: Unsigned,

Source§

type Item = &'a A

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, A>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a, N, A> IntoIterator for &'a mut Vec<N, A>
where N: Unsigned,

Source§

type Item = &'a mut A

The type of the elements being iterated over.
Source§

type IntoIter = IterMut<'a, A>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<N, A> IntoIterator for Vec<N, A>
where N: Unsigned,

Source§

type Item = A

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<A>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<N, A: Ord> Ord for Vec<N, A>
where N: Unsigned + Ord,

Source§

fn cmp(&self, other: &Vec<N, A>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<N, A: PartialEq> PartialEq for Vec<N, A>
where N: Unsigned + PartialEq,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<N, A: PartialOrd> PartialOrd for Vec<N, A>
where N: Unsigned + PartialOrd,

Source§

fn partial_cmp(&self, other: &Vec<N, A>) -> 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

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

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

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<'a, N, A> TryFrom<&'a [A]> for Vec<N, A>
where A: Clone, N: Unsigned,

Source§

fn try_from(slice: &'a [A]) -> Result<Self, Self::Error>

Construct a vector of size N from a slice of clonable values.

Returns Err(()) if the source slice didn’t contain exactly N elements.

§Examples
let good_vec: Result<Vec<U3, _>, _> = Vec::try_from([1, 2, 3].as_ref());
assert_eq!(Ok(svec![1, 2, 3]), good_vec);

let bad_vec: Result<Vec<U3, _>, _> = Vec::try_from([1, 2].as_ref());
assert_eq!(Err(()), bad_vec);
Source§

type Error = ()

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

impl<N, A> TryFrom<Box<[A]>> for Vec<N, A>
where N: Unsigned,

Source§

fn try_from(array: Box<[A]>) -> Result<Self, Self::Error>

Construct a vector of size N from a boxed array.

Returns Err(()) if the source vector didn’t contain exactly N elements.

§Examples
let boxed: Box<[_]> = Box::new([1, 2, 3]);
let good_vec: Result<Vec<U3, _>, _> = Vec::try_from(boxed);
assert_eq!(Ok(svec![1, 2, 3]), good_vec);

let boxed: Box<[_]> = Box::new([1, 2]);
let bad_vec: Result<Vec<U3, _>, _> = Vec::try_from(boxed);
assert_eq!(Err(()), bad_vec);
Source§

type Error = ()

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

impl<N, A> TryFrom<Vec<A>> for Vec<N, A>
where N: Unsigned,

Source§

fn try_from(vec: Vec<A>) -> Result<Self, Self::Error>

Construct a vector of size N from a std::vec::Vec.

Returns Err(()) if the source vector didn’t contain exactly N elements.

§Examples
let good_vec: Result<Vec<U3, _>, _> = Vec::try_from(vec![1, 2, 3]);
assert_eq!(Ok(svec![1, 2, 3]), good_vec);

let bad_vec: Result<Vec<U3, _>, _> = Vec::try_from(vec![1, 2]);
assert_eq!(Err(()), bad_vec);
Source§

type Error = ()

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

impl<N, A: Eq> Eq for Vec<N, A>
where N: Unsigned + Eq,

Source§

impl<N, A> StructuralPartialEq for Vec<N, A>
where N: Unsigned,

Auto Trait Implementations§

§

impl<N, A> Freeze for Vec<N, A>

§

impl<N, A> RefUnwindSafe for Vec<N, A>

§

impl<N, A> Send for Vec<N, A>
where N: Send, A: Send,

§

impl<N, A> Sync for Vec<N, A>
where N: Sync, A: Sync,

§

impl<N, A> Unpin for Vec<N, A>
where N: Unpin, A: Unpin,

§

impl<N, A> UnwindSafe for Vec<N, A>
where N: UnwindSafe, A: UnwindSafe,

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: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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

Source§

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

Source§

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.