Array

Struct Array 

Source
#[repr(transparent)]
pub struct Array<T, S: ConstShape>(pub S::Inner<T>);
Expand description

Multidimensional array with constant-sized dimensions and inline allocation.

Tuple Fields§

§0: S::Inner<T>

Implementations§

Source§

impl<T, S: ConstShape> Array<T, S>

Source

pub fn from_elem(elem: T) -> Self
where T: Clone,

Creates an array from the given element.

Source

pub fn from_fn<F: FnMut(&[usize]) -> T>(f: F) -> Self

Creates an array with the results from the given function.

Source

pub fn into_scalar(self) -> T

Converts an array with a single element into the contained value.

§Panics

Panics if the array length is not equal to one.

Source

pub fn into_shape<I: ConstShape>(self) -> Array<T, I>

Converts the array into a reshaped array, which must have the same length.

§Panics

Panics if the array length is changed.

Source

pub fn map<U, F: FnMut(T) -> U>(self, f: F) -> Array<U, S>

Returns an array with the same shape, and the given closure applied to each element.

Source

pub fn uninit() -> Array<MaybeUninit<T>, S>

Creates an array with uninitialized elements.

Source

pub fn zeros() -> Self
where T: Default,

Creates an array with elements set to zero.

Zero elements are created using Default::default().

Source§

impl<T, S: ConstShape> Array<MaybeUninit<T>, S>

Source

pub unsafe fn assume_init(self) -> Array<T, S>

Converts the array element type from MaybeUninit<T> to T.

§Safety

All elements in the array must be initialized, or the behavior is undefined.

Methods from Deref<Target = Slice<T, S>>§

Source

pub fn as_mut_ptr(&mut self) -> *mut T

Returns a mutable pointer to the array buffer.

Source

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the array buffer.

Source

pub fn assign<I: IntoExpression<Item: IntoCloned<T>>>(&mut self, expr: I)

Assigns an expression to the array slice with broadcasting, cloning elements if needed.

§Panics

Panics if the expression cannot be broadcast to the shape of the array slice.

Source

pub fn at(&self, index: usize) -> View<'_, T, S::Tail, L>

Returns an array view after indexing the first dimension.

§Panics

Panics if the index is out of bounds, or if the rank is not at least 1.

Source

pub fn at_mut(&mut self, index: usize) -> ViewMut<'_, T, S::Tail, L>

Returns a mutable array view after indexing the first dimension.

§Panics

Panics if the index is out of bounds, or if the rank is not at least 1.

Source

pub fn axis_at<A: Axis>( &self, axis: A, index: usize, ) -> View<'_, T, A::Remove<S>, Split<A, S, L>>

Returns an array view after indexing the specified dimension.

If the dimension to be indexed is know at compile time, the resulting array shape will maintain constant-sized dimensions. Furthermore, if it is the first dimension the resulting array view has the same layout as the input.

§Panics

Panics if the dimension or the index is out of bounds.

Source

pub fn axis_at_mut<A: Axis>( &mut self, axis: A, index: usize, ) -> ViewMut<'_, T, A::Remove<S>, Split<A, S, L>>

Returns a mutable array view after indexing the specified dimension.

If the dimension to be indexed is know at compile time, the resulting array shape will maintain constant-sized dimensions. Furthermore, if it is the first dimension the resulting array view has the same layout as the input.

§Panics

Panics if the dimension or the index is out of bounds.

Source

pub fn axis_expr<A: Axis>(&self, axis: A) -> AxisExpr<'_, T, S, L, A>

Returns an expression that gives array views iterating over the specified dimension.

If the dimension to be iterated over is know at compile time, the resulting array shape will maintain constant-sized dimensions. Furthermore, if it is the first dimension the resulting array views have the same layout as the input.

§Panics

Panics if the dimension is out of bounds.

Source

pub fn axis_expr_mut<A: Axis>(&mut self, axis: A) -> AxisExprMut<'_, T, S, L, A>

Returns a mutable expression that gives array views iterating over the specified dimension.

If the dimension to be iterated over is know at compile time, the resulting array shape will maintain constant-sized dimensions. Furthermore, if it is the first dimension the resulting array views have the same layout as the input.

§Panics

Panics if the dimension is out of bounds.

Source

pub fn col(&self, index: usize) -> View<'_, T, (S::Head,), Strided>

Returns an array view for the specified column.

§Panics

Panics if the rank is not equal to 2, or if the index is out of bounds.

Source

pub fn col_mut(&mut self, index: usize) -> ViewMut<'_, T, (S::Head,), Strided>

Returns a mutable array view for the specified column.

§Panics

Panics if the rank is not equal to 2, or if the index is out of bounds.

Source

pub fn cols(&self) -> Lanes<'_, T, S, L, Cols>

Returns an expression that gives column views iterating over the other dimensions.

§Panics

Panics if the rank is not at least 2.

Source

pub fn cols_mut(&mut self) -> LanesMut<'_, T, S, L, Cols>

Returns a mutable expression that gives column views iterating over the other dimensions.

§Panics

Panics if the rank is not at least 2.

Source

pub fn contains(&self, x: &T) -> bool
where T: PartialEq,

Returns true if the array slice contains an element with the given value.

Source

pub fn diag(&self, index: isize) -> View<'_, T, (Dyn,), Strided>

Returns an array view for the given diagonal of the array slice, where index > 0 is above and index < 0 is below the main diagonal.

§Panics

Panics if the rank is not equal to 2, or if the absolute index is larger than the number of columns or rows.

Source

pub fn diag_mut(&mut self, index: isize) -> ViewMut<'_, T, (Dyn,), Strided>

Returns a mutable array view for the given diagonal of the array slice, where index > 0 is above and index < 0 is below the main diagonal.

§Panics

Panics if the rank is not equal to 2, or if the absolute index is larger than the number of columns or rows.

Source

pub fn dim(&self, index: usize) -> usize

Returns the number of elements in the specified dimension.

§Panics

Panics if the dimension is out of bounds.

Source

pub fn expr(&self) -> View<'_, T, S, L>

Returns an expression over the array slice.

Source

pub fn expr_mut(&mut self) -> ViewMut<'_, T, S, L>

Returns a mutable expression over the array slice.

Source

pub fn fill(&mut self, value: T)
where T: Clone,

Fills the array slice with elements by cloning value.

Source

pub fn fill_with<F: FnMut() -> T>(&mut self, f: F)

Fills the array slice with elements returned by calling a closure repeatedly.

Source

pub fn flatten(&self) -> View<'_, T, (Dyn,), L>

Returns a one-dimensional array view of the array slice.

§Panics

Panics if the array layout is not uniformly strided.

Source

pub fn flatten_mut(&mut self) -> ViewMut<'_, T, (Dyn,), L>

Returns a mutable one-dimensional array view over the array slice.

§Panics

Panics if the array layout is not uniformly strided.

Source

pub unsafe fn get_unchecked<I: SliceIndex<T, S, L>>( &self, index: I, ) -> &I::Output

Returns a reference to an element or a subslice, without doing bounds checking.

§Safety

The index must be within bounds of the array slice.

Source

pub unsafe fn get_unchecked_mut<I: SliceIndex<T, S, L>>( &mut self, index: I, ) -> &mut I::Output

Returns a mutable reference to an element or a subslice, without doing bounds checking.

§Safety

The index must be within bounds of the array slice.

Source

pub fn is_contiguous(&self) -> bool

Returns true if the array strides are consistent with contiguous memory layout.

Source

pub fn is_empty(&self) -> bool

Returns true if the array contains no elements.

Source

pub fn iter(&self) -> Iter<View<'_, T, S, L>>

Returns an iterator over the array slice.

Source

pub fn iter_mut(&mut self) -> Iter<ViewMut<'_, T, S, L>>

Returns a mutable iterator over the array slice.

Source

pub fn lanes<A: Axis>(&self, axis: A) -> Lanes<'_, T, S, L, A>

Returns an expression that gives array views over the specified dimension, iterating over the other dimensions.

If the dimension to give array views over is know at compile time, the resulting shape will maintain a constant-sized dimension. Furthermore, if it is the last dimension the resulting array views have the same layout as the input.

§Panics

Panics if the dimension is out of bounds.

Source

pub fn lanes_mut<A: Axis>(&mut self, axis: A) -> LanesMut<'_, T, S, L, A>

Returns a mutable expression that gives array views over the specified dimension, iterating over the other dimensions.

If the dimension to give array views over is know at compile time, the resulting shape will maintain a constant-sized dimension. Furthermore, if it is the last dimension the resulting array views have the same layout as the input.

§Panics

Panics if the dimension is out of bounds.

Source

pub fn len(&self) -> usize

Returns the number of elements in the array.

Source

pub fn mapping(&self) -> &L::Mapping<S>

Returns the array layout mapping.

Source

pub fn outer_expr(&self) -> AxisExpr<'_, T, S, L, Const<0>>

Returns an expression that gives array views iterating over the first dimension.

Iterating over the first dimension results in array views with the same layout as the input.

§Panics

Panics if the rank is not at least 1.

Source

pub fn outer_expr_mut(&mut self) -> AxisExprMut<'_, T, S, L, Const<0>>

Returns a mutable expression that gives array views iterating over the first dimension.

Iterating over the first dimension results in array views with the same layout as the input.

§Panics

Panics if the rank is not at least 1.

Source

pub fn permute<I: IntoShape<IntoShape: Permutation>>( &self, perm: I, ) -> View<'_, T, <I::IntoShape as Permutation>::Shape<S>, <I::IntoShape as Permutation>::Layout<L>>

Returns an array view with the dimensions permuted.

If the permutation is an identity permutation and known at compile time, the resulting array view has the same layout as the input. For example, permuting with (Const::<0>, Const::<1>) will maintain the layout while permuting with [0, 1] gives strided layout.

§Panics

Panics if the permutation is not valid.

Source

pub fn permute_mut<I: IntoShape<IntoShape: Permutation>>( &mut self, perm: I, ) -> ViewMut<'_, T, <I::IntoShape as Permutation>::Shape<S>, <I::IntoShape as Permutation>::Layout<L>>

Returns a mutable array view with the dimensions permuted.

If the permutation is an identity permutation and known at compile time, the resulting array view has the same layout as the input. For example, permuting with (Const::<0>, Const::<1>) will maintain the layout while permuting with [0, 1] gives strided layout.

§Panics

Panics if the permutation is not valid.

Source

pub fn rank(&self) -> usize

Returns the array rank, i.e. the number of dimensions.

Source

pub fn remap<R: Shape, K: Layout>(&self) -> View<'_, T, R, K>

Returns a remapped array view of the array slice.

§Panics

Panics if the memory layout is not compatible with the new array layout.

Source

pub fn remap_mut<R: Shape, K: Layout>(&mut self) -> ViewMut<'_, T, R, K>

Returns a mutable remapped array view of the array slice.

§Panics

Panics if the memory layout is not compatible with the new array layout.

Source

pub fn reorder(&self) -> View<'_, T, S::Reverse, <S::Tail as Shape>::Layout<L>>

👎Deprecated

Returns a reordered array view of the array slice.

This method is deprecated, use transpose instead.

Source

pub fn reorder_mut( &mut self, ) -> ViewMut<'_, T, S::Reverse, <S::Tail as Shape>::Layout<L>>

👎Deprecated

Returns a mutable reordered array view of the array slice.

This method is deprecated, use transpose_mut instead.

Source

pub fn reshape<I: IntoShape>(&self, shape: I) -> View<'_, T, I::IntoShape, L>

Returns a reshaped array view of the array slice.

At most one dimension can have dynamic size usize::MAX, and is then inferred from the other dimensions and the array length.

§Examples
use mdarray::view;

let v = view![[1, 2, 3], [4, 5, 6]];

assert_eq!(v.reshape([!0, 2]), view![[1, 2], [3, 4], [5, 6]]);
§Panics

Panics if the array length is changed, or if the memory layout is not compatible.

Source

pub fn reshape_mut<I: IntoShape>( &mut self, shape: I, ) -> ViewMut<'_, T, I::IntoShape, L>

Returns a mutable reshaped array view of the array slice.

At most one dimension can have dynamic size usize::MAX, and is then inferred from the other dimensions and the array length.

See the reshape method above for examples.

§Panics

Panics if the array length is changed, or if the memory layout is not compatible.

Source

pub fn row(&self, index: usize) -> View<'_, T, (<S::Tail as Shape>::Head,), L>

Returns an array view for the specified row.

§Panics

Panics if the rank is not equal to 2, or if the index is out of bounds.

Source

pub fn row_mut( &mut self, index: usize, ) -> ViewMut<'_, T, (<S::Tail as Shape>::Head,), L>

Returns a mutable array view for the specified row.

§Panics

Panics if the rank is not equal to 2, or if the index is out of bounds.

Source

pub fn rows(&self) -> Lanes<'_, T, S, L, Rows>

Returns an expression that gives row views iterating over the other dimensions.

§Panics

Panics if the rank is not at least 1.

Source

pub fn rows_mut(&mut self) -> LanesMut<'_, T, S, L, Rows>

Returns a mutable expression that gives row views iterating over the other dimensions.

§Panics

Panics if the rank is not at least 1.

Source

pub fn shape(&self) -> &S

Returns the array shape.

Source

pub fn split_at( &self, mid: usize, ) -> (View<'_, T, Resize<Const<0>, S>, L>, View<'_, T, Resize<Const<0>, S>, L>)

Divides an array slice into two at an index along the first dimension.

§Panics

Panics if the split point is larger than the number of elements in that dimension, or if the rank is not at least 1.

Source

pub fn split_at_mut( &mut self, mid: usize, ) -> (ViewMut<'_, T, Resize<Const<0>, S>, L>, ViewMut<'_, T, Resize<Const<0>, S>, L>)

Divides a mutable array slice into two at an index along the first dimension.

§Panics

Panics if the split point is larger than the number of elements in that dimension, or if the rank is not at least 1.

Source

pub fn split_axis_at<A: Axis>( &self, axis: A, mid: usize, ) -> (View<'_, T, Resize<A, S>, Split<A, S, L>>, View<'_, T, Resize<A, S>, Split<A, S, L>>)

Divides an array slice into two at an index along the specified dimension.

If the dimension to be divided is know at compile time, the resulting array shape will maintain constant-sized dimensions. Furthermore, if it is the first dimension the resulting array views have the same layout as the input.

§Panics

Panics if the split point is larger than the number of elements in that dimension, or if the dimension is out of bounds.

Source

pub fn split_axis_at_mut<A: Axis>( &mut self, axis: A, mid: usize, ) -> (ViewMut<'_, T, Resize<A, S>, Split<A, S, L>>, ViewMut<'_, T, Resize<A, S>, Split<A, S, L>>)

Divides a mutable array slice into two at an index along the specified dimension.

If the dimension to be divided is know at compile time, the resulting array shape will maintain constant-sized dimensions. Furthermore, if it is the first dimension the resulting array views have the same layout as the input.

§Panics

Panics if the split point is larger than the number of elements in that dimension, or if the dimension is out of bounds.

Source

pub fn stride(&self, index: usize) -> isize

Returns the distance between elements in the specified dimension.

§Panics

Panics if the dimension is out of bounds.

Source

pub fn swap<I, J>(&mut self, a: I, b: J)
where I: SliceIndex<T, S, L, Output = T>, J: SliceIndex<T, S, L, Output = T>,

Swaps two elements in the array slice.

§Panics

Panics if a or b are out of bounds.

Source

pub fn swap_axis<A: Axis>(&mut self, axis: A, a: usize, b: usize)

Swaps the elements in two subarrays after indexing the specified dimension.

§Panics

Panics if a or b are out of bounds.

Source

pub fn to_array(&self) -> Array<T, S>
where T: Clone, S: ConstShape,

Copies the array slice into a new array.

Source

pub fn to_tensor(&self) -> Tensor<T, S>
where T: Clone,

Copies the array slice into a new array.

Source

pub fn to_vec(&self) -> Vec<T>
where T: Clone,

Copies the array slice into a new vector.

Source

pub fn transpose( &self, ) -> View<'_, T, S::Reverse, <S::Tail as Shape>::Layout<L>>

Returns a transposed array view of the array slice, where the dimensions are reversed.

Source

pub fn transpose_mut( &mut self, ) -> ViewMut<'_, T, S::Reverse, <S::Tail as Shape>::Layout<L>>

Returns a mutable transposed array view of the array slice, where the dimensions are reversed.

Source

pub fn strides(&self) -> &[isize]

Returns the distance between elements in each dimension.

Trait Implementations§

Source§

impl<'a, T, U, S: ConstShape, I: Apply<U>> Add<I> for &'a Array<T, S>
where &'a T: Add<I::Item, Output = U>,

Source§

type Output = <I as Apply<U>>::ZippedWith<&'a Array<T, S>, fn((<I as IntoIterator>::Item, &'a T)) -> U>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: I) -> Self::Output

Performs the + operation. Read more
Source§

impl<T, U, S: ConstShape, I: IntoExpression> Add<I> for Array<T, S>
where T: Add<I::Item, Output = U>,

Source§

type Output = Array<U, S>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: I) -> Self::Output

Performs the + operation. Read more
Source§

impl<T, S: ConstShape, I: IntoExpression> AddAssign<I> for Array<T, S>
where T: AddAssign<I::Item>,

Source§

fn add_assign(&mut self, rhs: I)

Performs the += operation. Read more
Source§

impl<'a, T, U, S: ConstShape> Apply<U> for &'a Array<T, S>

Source§

type Output<F: FnMut(&'a T) -> U> = Map<<&'a Array<T, S> as IntoExpression>::IntoExpr, F>

The resulting type after applying a closure.
Source§

type ZippedWith<I: IntoExpression, F: FnMut((&'a T, I::Item)) -> U> = Map<Zip<<&'a Array<T, S> as IntoExpression>::IntoExpr, <I as IntoExpression>::IntoExpr>, F>

The resulting type after zipping elements and applying a closure.
Source§

fn apply<F: FnMut(&'a T) -> U>(self, f: F) -> Self::Output<F>

Returns the array or an expression with the given closure applied to each element.
Source§

fn zip_with<I: IntoExpression, F>(self, expr: I, f: F) -> Self::ZippedWith<I, F>
where F: FnMut((&'a T, I::Item)) -> U,

Returns the array or an expression with the given closure applied to zipped element pairs.
Source§

impl<'a, T, U, S: ConstShape> Apply<U> for &'a mut Array<T, S>

Source§

type Output<F: FnMut(&'a mut T) -> U> = Map<<&'a mut Array<T, S> as IntoExpression>::IntoExpr, F>

The resulting type after applying a closure.
Source§

type ZippedWith<I: IntoExpression, F: FnMut((&'a mut T, I::Item)) -> U> = Map<Zip<<&'a mut Array<T, S> as IntoExpression>::IntoExpr, <I as IntoExpression>::IntoExpr>, F>

The resulting type after zipping elements and applying a closure.
Source§

fn apply<F: FnMut(&'a mut T) -> U>(self, f: F) -> Self::Output<F>

Returns the array or an expression with the given closure applied to each element.
Source§

fn zip_with<I: IntoExpression, F>(self, expr: I, f: F) -> Self::ZippedWith<I, F>
where F: FnMut((&'a mut T, I::Item)) -> U,

Returns the array or an expression with the given closure applied to zipped element pairs.
Source§

impl<T, U, S: ConstShape> Apply<U> for Array<T, S>

Source§

type Output<F: FnMut(T) -> U> = Array<U, S>

The resulting type after applying a closure.
Source§

type ZippedWith<I: IntoExpression, F: FnMut((T, I::Item)) -> U> = Array<U, S>

The resulting type after zipping elements and applying a closure.
Source§

fn apply<F: FnMut(T) -> U>(self, f: F) -> Array<U, S>

Returns the array or an expression with the given closure applied to each element.
Source§

fn zip_with<I: IntoExpression, F>(self, expr: I, f: F) -> Array<U, S>
where F: FnMut((T, I::Item)) -> U,

Returns the array or an expression with the given closure applied to zipped element pairs.
Source§

impl<T, const X: usize> AsMut<Array<T, (Const<X>,)>> for [T; X]

Source§

fn as_mut(&mut self) -> &mut Array<T, (Const<X>,)>

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

impl<T, const X: usize, const Y: usize> AsMut<Array<T, (Const<X>, Const<Y>)>> for [[T; Y]; X]

Source§

fn as_mut(&mut self) -> &mut Array<T, (Const<X>, Const<Y>)>

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

impl<T, const X: usize, const Y: usize, const Z: usize> AsMut<Array<T, (Const<X>, Const<Y>, Const<Z>)>> for [[[T; Z]; Y]; X]

Source§

fn as_mut(&mut self) -> &mut Array<T, (Const<X>, Const<Y>, Const<Z>)>

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

impl<T, const X: usize, const Y: usize, const Z: usize, const W: usize> AsMut<Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>)>> for [[[[T; W]; Z]; Y]; X]

Source§

fn as_mut(&mut self) -> &mut Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>)>

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

impl<T, const X: usize, const Y: usize, const Z: usize, const W: usize, const U: usize> AsMut<Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>, Const<U>)>> for [[[[[T; U]; W]; Z]; Y]; X]

Source§

fn as_mut( &mut self, ) -> &mut Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>, Const<U>)>

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

impl<T, const X: usize, const Y: usize, const Z: usize, const W: usize, const U: usize, const V: usize> AsMut<Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>, Const<U>, Const<V>)>> for [[[[[[T; V]; U]; W]; Z]; Y]; X]

Source§

fn as_mut( &mut self, ) -> &mut Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>, Const<U>, Const<V>)>

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

impl<T, U: ?Sized, S: ConstShape> AsMut<U> for Array<T, S>
where Slice<T, S>: AsMut<U>,

Source§

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

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

impl<T, const X: usize> AsRef<Array<T, (Const<X>,)>> for [T; X]

Source§

fn as_ref(&self) -> &Array<T, (Const<X>,)>

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

impl<T, const X: usize, const Y: usize> AsRef<Array<T, (Const<X>, Const<Y>)>> for [[T; Y]; X]

Source§

fn as_ref(&self) -> &Array<T, (Const<X>, Const<Y>)>

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

impl<T, const X: usize, const Y: usize, const Z: usize> AsRef<Array<T, (Const<X>, Const<Y>, Const<Z>)>> for [[[T; Z]; Y]; X]

Source§

fn as_ref(&self) -> &Array<T, (Const<X>, Const<Y>, Const<Z>)>

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

impl<T, const X: usize, const Y: usize, const Z: usize, const W: usize> AsRef<Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>)>> for [[[[T; W]; Z]; Y]; X]

Source§

fn as_ref(&self) -> &Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>)>

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

impl<T, const X: usize, const Y: usize, const Z: usize, const W: usize, const U: usize> AsRef<Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>, Const<U>)>> for [[[[[T; U]; W]; Z]; Y]; X]

Source§

fn as_ref( &self, ) -> &Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>, Const<U>)>

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

impl<T, const X: usize, const Y: usize, const Z: usize, const W: usize, const U: usize, const V: usize> AsRef<Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>, Const<U>, Const<V>)>> for [[[[[[T; V]; U]; W]; Z]; Y]; X]

Source§

fn as_ref( &self, ) -> &Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>, Const<U>, Const<V>)>

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

impl<T, U: ?Sized, S: ConstShape> AsRef<U> for Array<T, S>
where Slice<T, S>: AsRef<U>,

Source§

fn as_ref(&self) -> &U

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

impl<'a, T, U, S: ConstShape, I: Apply<U>> BitAnd<I> for &'a Array<T, S>
where &'a T: BitAnd<I::Item, Output = U>,

Source§

type Output = <I as Apply<U>>::ZippedWith<&'a Array<T, S>, fn((<I as IntoIterator>::Item, &'a T)) -> U>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: I) -> Self::Output

Performs the & operation. Read more
Source§

impl<T, U, S: ConstShape, I: IntoExpression> BitAnd<I> for Array<T, S>
where T: BitAnd<I::Item, Output = U>,

Source§

type Output = Array<U, S>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: I) -> Self::Output

Performs the & operation. Read more
Source§

impl<T, S: ConstShape, I: IntoExpression> BitAndAssign<I> for Array<T, S>
where T: BitAndAssign<I::Item>,

Source§

fn bitand_assign(&mut self, rhs: I)

Performs the &= operation. Read more
Source§

impl<'a, T, U, S: ConstShape, I: Apply<U>> BitOr<I> for &'a Array<T, S>
where &'a T: BitOr<I::Item, Output = U>,

Source§

type Output = <I as Apply<U>>::ZippedWith<&'a Array<T, S>, fn((<I as IntoIterator>::Item, &'a T)) -> U>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: I) -> Self::Output

Performs the | operation. Read more
Source§

impl<T, U, S: ConstShape, I: IntoExpression> BitOr<I> for Array<T, S>
where T: BitOr<I::Item, Output = U>,

Source§

type Output = Array<U, S>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: I) -> Self::Output

Performs the | operation. Read more
Source§

impl<T, S: ConstShape, I: IntoExpression> BitOrAssign<I> for Array<T, S>
where T: BitOrAssign<I::Item>,

Source§

fn bitor_assign(&mut self, rhs: I)

Performs the |= operation. Read more
Source§

impl<'a, T, U, S: ConstShape, I: Apply<U>> BitXor<I> for &'a Array<T, S>
where &'a T: BitXor<I::Item, Output = U>,

Source§

type Output = <I as Apply<U>>::ZippedWith<&'a Array<T, S>, fn((<I as IntoIterator>::Item, &'a T)) -> U>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: I) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<T, U, S: ConstShape, I: IntoExpression> BitXor<I> for Array<T, S>
where T: BitXor<I::Item, Output = U>,

Source§

type Output = Array<U, S>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: I) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<T, S: ConstShape, I: IntoExpression> BitXorAssign<I> for Array<T, S>
where T: BitXorAssign<I::Item>,

Source§

fn bitxor_assign(&mut self, rhs: I)

Performs the ^= operation. Read more
Source§

impl<T, S: ConstShape> Borrow<Slice<T, S>> for Array<T, S>

Source§

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

Immutably borrows from an owned value. Read more
Source§

impl<T, S: ConstShape> BorrowMut<Slice<T, S>> for Array<T, S>

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T, S: ConstShape> Buffer for Array<ManuallyDrop<T>, S>

Source§

type Item = T

Array element type.
Source§

type Shape = S

Array shape type.
Source§

impl<T: Clone, S: Clone + ConstShape> Clone for Array<T, S>
where S::Inner<T>: Clone,

Source§

fn clone(&self) -> Array<T, S>

Returns a duplicate 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, S: ConstShape> Debug for Array<T, S>

Source§

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

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

impl<T: Default, S: Default + ConstShape> Default for Array<T, S>
where S::Inner<T>: Default,

Source§

fn default() -> Array<T, S>

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

impl<T, S: ConstShape> Deref for Array<T, S>

Source§

type Target = Slice<T, S>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T, S: ConstShape> DerefMut for Array<T, S>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<'a, T, U, S: ConstShape, I: Apply<U>> Div<I> for &'a Array<T, S>
where &'a T: Div<I::Item, Output = U>,

Source§

type Output = <I as Apply<U>>::ZippedWith<&'a Array<T, S>, fn((<I as IntoIterator>::Item, &'a T)) -> U>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: I) -> Self::Output

Performs the / operation. Read more
Source§

impl<T, U, S: ConstShape, I: IntoExpression> Div<I> for Array<T, S>
where T: Div<I::Item, Output = U>,

Source§

type Output = Array<U, S>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: I) -> Self::Output

Performs the / operation. Read more
Source§

impl<T, S: ConstShape, I: IntoExpression> DivAssign<I> for Array<T, S>
where T: DivAssign<I::Item>,

Source§

fn div_assign(&mut self, rhs: I)

Performs the /= operation. Read more
Source§

impl<T: Clone, const X: usize, const Y: usize, const Z: usize, const W: usize, const U: usize, const V: usize> From<&[[[[[[T; V]; U]; W]; Z]; Y]; X]> for Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>, Const<U>, Const<V>)>

Source§

fn from(array: &[[[[[[T; V]; U]; W]; Z]; Y]; X]) -> Self

Converts to this type from the input type.
Source§

impl<T: Clone, const X: usize, const Y: usize, const Z: usize, const W: usize, const U: usize> From<&[[[[[T; U]; W]; Z]; Y]; X]> for Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>, Const<U>)>

Source§

fn from(array: &[[[[[T; U]; W]; Z]; Y]; X]) -> Self

Converts to this type from the input type.
Source§

impl<T: Clone, const X: usize, const Y: usize, const Z: usize, const W: usize> From<&[[[[T; W]; Z]; Y]; X]> for Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>)>

Source§

fn from(array: &[[[[T; W]; Z]; Y]; X]) -> Self

Converts to this type from the input type.
Source§

impl<T: Clone, const X: usize, const Y: usize, const Z: usize> From<&[[[T; Z]; Y]; X]> for Array<T, (Const<X>, Const<Y>, Const<Z>)>

Source§

fn from(array: &[[[T; Z]; Y]; X]) -> Self

Converts to this type from the input type.
Source§

impl<T: Clone, const X: usize, const Y: usize> From<&[[T; Y]; X]> for Array<T, (Const<X>, Const<Y>)>

Source§

fn from(array: &[[T; Y]; X]) -> Self

Converts to this type from the input type.
Source§

impl<T: Clone, const X: usize> From<&[T; X]> for Array<T, (Const<X>,)>

Source§

fn from(array: &[T; X]) -> Self

Converts to this type from the input type.
Source§

impl<T, const X: usize, const Y: usize, const Z: usize, const W: usize, const U: usize, const V: usize> From<[[[[[[T; V]; U]; W]; Z]; Y]; X]> for Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>, Const<U>, Const<V>)>

Source§

fn from(array: [[[[[[T; V]; U]; W]; Z]; Y]; X]) -> Self

Converts to this type from the input type.
Source§

impl<T, const X: usize, const Y: usize, const Z: usize, const W: usize, const U: usize> From<[[[[[T; U]; W]; Z]; Y]; X]> for Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>, Const<U>)>

Source§

fn from(array: [[[[[T; U]; W]; Z]; Y]; X]) -> Self

Converts to this type from the input type.
Source§

impl<T, const X: usize, const Y: usize, const Z: usize, const W: usize> From<[[[[T; W]; Z]; Y]; X]> for Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>)>

Source§

fn from(array: [[[[T; W]; Z]; Y]; X]) -> Self

Converts to this type from the input type.
Source§

impl<T, const X: usize, const Y: usize, const Z: usize> From<[[[T; Z]; Y]; X]> for Array<T, (Const<X>, Const<Y>, Const<Z>)>

Source§

fn from(array: [[[T; Z]; Y]; X]) -> Self

Converts to this type from the input type.
Source§

impl<T, const X: usize, const Y: usize> From<[[T; Y]; X]> for Array<T, (Const<X>, Const<Y>)>

Source§

fn from(array: [[T; Y]; X]) -> Self

Converts to this type from the input type.
Source§

impl<T, const X: usize> From<[T; X]> for Array<T, (Const<X>,)>

Source§

fn from(array: [T; X]) -> Self

Converts to this type from the input type.
Source§

impl<T, const X: usize> From<Array<T, (Const<X>,)>> for [T; X]

Source§

fn from(array: Array<T, (Const<X>,)>) -> Self

Converts to this type from the input type.
Source§

impl<T, const X: usize, const Y: usize> From<Array<T, (Const<X>, Const<Y>)>> for [[T; Y]; X]

Source§

fn from(array: Array<T, (Const<X>, Const<Y>)>) -> Self

Converts to this type from the input type.
Source§

impl<T, const X: usize, const Y: usize, const Z: usize> From<Array<T, (Const<X>, Const<Y>, Const<Z>)>> for [[[T; Z]; Y]; X]

Source§

fn from(array: Array<T, (Const<X>, Const<Y>, Const<Z>)>) -> Self

Converts to this type from the input type.
Source§

impl<T, const X: usize, const Y: usize, const Z: usize, const W: usize> From<Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>)>> for [[[[T; W]; Z]; Y]; X]

Source§

fn from(array: Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>)>) -> Self

Converts to this type from the input type.
Source§

impl<T, const X: usize, const Y: usize, const Z: usize, const W: usize, const U: usize> From<Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>, Const<U>)>> for [[[[[T; U]; W]; Z]; Y]; X]

Source§

fn from( array: Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>, Const<U>)>, ) -> Self

Converts to this type from the input type.
Source§

impl<T, const X: usize, const Y: usize, const Z: usize, const W: usize, const U: usize, const V: usize> From<Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>, Const<U>, Const<V>)>> for [[[[[[T; V]; U]; W]; Z]; Y]; X]

Source§

fn from( array: Array<T, (Const<X>, Const<Y>, Const<Z>, Const<W>, Const<U>, Const<V>)>, ) -> Self

Converts to this type from the input type.
Source§

impl<T, S: ConstShape> From<Array<T, S>> for Tensor<T, S>

Source§

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

Converts to this type from the input type.
Source§

impl<'a, T: 'a + Clone, S: ConstShape, L: Layout, I> From<I> for Array<T, S>
where I: IntoExpression<IntoExpr = View<'a, T, S, L>>,

Source§

fn from(value: I) -> Self

Converts to this type from the input type.
Source§

impl<T, S: ConstShape> From<Tensor<T, S>> for Array<T, S>

Source§

fn from(value: Tensor<T, S>) -> Self

Converts to this type from the input type.
Source§

impl<T, S: ConstShape> FromExpression<T, S> for Array<T, S>

Source§

fn from_expr<I: IntoExpression<Item = T, Shape = S>>(expr: I) -> Self

Creates an array from an expression.
Source§

impl<T: Hash, S: ConstShape> Hash for Array<T, S>

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<T, S: ConstShape, I: SliceIndex<T, S, Dense>> Index<I> for Array<T, S>

Source§

type Output = <I as SliceIndex<T, S, Dense>>::Output

The returned type after indexing.
Source§

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

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

impl<T, S: ConstShape, I: SliceIndex<T, S, Dense>> IndexMut<I> for Array<T, S>

Source§

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

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

impl<'a, T, S: ConstShape> IntoExpression for &'a Array<T, S>

Source§

type Shape = S

Array shape type.
Source§

type IntoExpr = View<'a, T, S>

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

fn into_expr(self) -> Self::IntoExpr

Creates an expression from a value.
Source§

impl<'a, T, S: ConstShape> IntoExpression for &'a mut Array<T, S>

Source§

type Shape = S

Array shape type.
Source§

type IntoExpr = ViewMut<'a, T, S>

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

fn into_expr(self) -> Self::IntoExpr

Creates an expression from a value.
Source§

impl<T, S: ConstShape> IntoExpression for Array<T, S>

Source§

type Shape = S

Array shape type.
Source§

type IntoExpr = IntoExpr<Array<ManuallyDrop<T>, S>>

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

fn into_expr(self) -> Self::IntoExpr

Creates an expression from a value.
Source§

impl<'a, T, S: ConstShape> IntoIterator for &'a Array<T, S>

Source§

type Item = &'a T

The type of the elements being iterated over.
Source§

type IntoIter = Iter<View<'a, T, S>>

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, T, S: ConstShape> IntoIterator for &'a mut Array<T, S>

Source§

type Item = &'a mut T

The type of the elements being iterated over.
Source§

type IntoIter = Iter<ViewMut<'a, T, S>>

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<T, S: ConstShape> IntoIterator for Array<T, S>

Source§

type Item = T

The type of the elements being iterated over.
Source§

type IntoIter = Iter<IntoExpr<Array<ManuallyDrop<T>, S>>>

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, T, U, S: ConstShape, I: Apply<U>> Mul<I> for &'a Array<T, S>
where &'a T: Mul<I::Item, Output = U>,

Source§

type Output = <I as Apply<U>>::ZippedWith<&'a Array<T, S>, fn((<I as IntoIterator>::Item, &'a T)) -> U>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: I) -> Self::Output

Performs the * operation. Read more
Source§

impl<T, U, S: ConstShape, I: IntoExpression> Mul<I> for Array<T, S>
where T: Mul<I::Item, Output = U>,

Source§

type Output = Array<U, S>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: I) -> Self::Output

Performs the * operation. Read more
Source§

impl<T, S: ConstShape, I: IntoExpression> MulAssign<I> for Array<T, S>
where T: MulAssign<I::Item>,

Source§

fn mul_assign(&mut self, rhs: I)

Performs the *= operation. Read more
Source§

impl<'a, T, U, S: ConstShape> Neg for &'a Array<T, S>
where &'a T: Neg<Output = U>,

Source§

type Output = <&'a Array<T, S> as Apply<U>>::Output<fn(&'a T) -> U>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<T, U, S: ConstShape> Neg for Array<T, S>
where T: Neg<Output = U>,

Source§

type Output = Array<U, S>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<'a, T, U, S: ConstShape> Not for &'a Array<T, S>
where &'a T: Not<Output = U>,

Source§

type Output = <&'a Array<T, S> as Apply<U>>::Output<fn(&'a T) -> U>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl<T, U, S: ConstShape> Not for Array<T, S>
where T: Not<Output = U>,

Source§

type Output = Array<U, S>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl<T, U, S: ConstShape, R: Shape, L: Layout, I: ?Sized> PartialEq<I> for Array<T, S>
where for<'a> &'a I: IntoExpression<IntoExpr = View<'a, U, R, L>>, T: PartialEq<U>,

Source§

fn eq(&self, other: &I) -> 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<'a, T, U, S: ConstShape, I: Apply<U>> Rem<I> for &'a Array<T, S>
where &'a T: Rem<I::Item, Output = U>,

Source§

type Output = <I as Apply<U>>::ZippedWith<&'a Array<T, S>, fn((<I as IntoIterator>::Item, &'a T)) -> U>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: I) -> Self::Output

Performs the % operation. Read more
Source§

impl<T, U, S: ConstShape, I: IntoExpression> Rem<I> for Array<T, S>
where T: Rem<I::Item, Output = U>,

Source§

type Output = Array<U, S>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: I) -> Self::Output

Performs the % operation. Read more
Source§

impl<T, S: ConstShape, I: IntoExpression> RemAssign<I> for Array<T, S>
where T: RemAssign<I::Item>,

Source§

fn rem_assign(&mut self, rhs: I)

Performs the %= operation. Read more
Source§

impl<'a, T, U, S: ConstShape, I: Apply<U>> Shl<I> for &'a Array<T, S>
where &'a T: Shl<I::Item, Output = U>,

Source§

type Output = <I as Apply<U>>::ZippedWith<&'a Array<T, S>, fn((<I as IntoIterator>::Item, &'a T)) -> U>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: I) -> Self::Output

Performs the << operation. Read more
Source§

impl<T, U, S: ConstShape, I: IntoExpression> Shl<I> for Array<T, S>
where T: Shl<I::Item, Output = U>,

Source§

type Output = Array<U, S>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: I) -> Self::Output

Performs the << operation. Read more
Source§

impl<T, S: ConstShape, I: IntoExpression> ShlAssign<I> for Array<T, S>
where T: ShlAssign<I::Item>,

Source§

fn shl_assign(&mut self, rhs: I)

Performs the <<= operation. Read more
Source§

impl<'a, T, U, S: ConstShape, I: Apply<U>> Shr<I> for &'a Array<T, S>
where &'a T: Shr<I::Item, Output = U>,

Source§

type Output = <I as Apply<U>>::ZippedWith<&'a Array<T, S>, fn((<I as IntoIterator>::Item, &'a T)) -> U>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: I) -> Self::Output

Performs the >> operation. Read more
Source§

impl<T, U, S: ConstShape, I: IntoExpression> Shr<I> for Array<T, S>
where T: Shr<I::Item, Output = U>,

Source§

type Output = Array<U, S>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: I) -> Self::Output

Performs the >> operation. Read more
Source§

impl<T, S: ConstShape, I: IntoExpression> ShrAssign<I> for Array<T, S>
where T: ShrAssign<I::Item>,

Source§

fn shr_assign(&mut self, rhs: I)

Performs the >>= operation. Read more
Source§

impl<'a, T, U, S: ConstShape, I: Apply<U>> Sub<I> for &'a Array<T, S>
where &'a T: Sub<I::Item, Output = U>,

Source§

type Output = <I as Apply<U>>::ZippedWith<&'a Array<T, S>, fn((<I as IntoIterator>::Item, &'a T)) -> U>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: I) -> Self::Output

Performs the - operation. Read more
Source§

impl<T, U, S: ConstShape, I: IntoExpression> Sub<I> for Array<T, S>
where T: Sub<I::Item, Output = U>,

Source§

type Output = Array<U, S>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: I) -> Self::Output

Performs the - operation. Read more
Source§

impl<T, S: ConstShape, I: IntoExpression> SubAssign<I> for Array<T, S>
where T: SubAssign<I::Item>,

Source§

fn sub_assign(&mut self, rhs: I)

Performs the -= operation. Read more
Source§

impl<T: Copy, S: Copy + ConstShape> Copy for Array<T, S>
where S::Inner<T>: Copy,

Source§

impl<T: Eq, S: ConstShape> Eq for Array<T, S>

Source§

impl<T, S: ConstShape> Owned<T, S> for Array<T, S>

Auto Trait Implementations§

§

impl<T, S> Freeze for Array<T, S>
where <S as ConstShape>::Inner<T>: Freeze,

§

impl<T, S> RefUnwindSafe for Array<T, S>
where <S as ConstShape>::Inner<T>: RefUnwindSafe,

§

impl<T, S> Send for Array<T, S>
where <S as ConstShape>::Inner<T>: Send,

§

impl<T, S> Sync for Array<T, S>
where <S as ConstShape>::Inner<T>: Sync,

§

impl<T, S> Unpin for Array<T, S>
where <S as ConstShape>::Inner<T>: Unpin,

§

impl<T, S> UnwindSafe for Array<T, S>
where <S as ConstShape>::Inner<T>: 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> IntoCloned<T> for T

Source§

fn clone_to(self, target: &mut T)

Moves an existing object or clones from a reference to the target object.
Source§

fn into_cloned(self) -> T

Returns an existing object or a new clone from a reference.
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.