Struct munum::Matrix

source ·
pub struct Matrix<T: Copy + NumAssign, const R: usize, const C: usize>(/* private fields */);
Expand description

A column-major numeric matrix.

Implementations§

source§

impl<T: Copy + NumAssign, const R: usize, const C: usize> Matrix<T, R, C>

source

pub fn new(data: [[T; R]; C]) -> Self

Creates a matrix from raw 2D array.

§Examples
let m = Matrix::<f32, 2, 2>::new([[1., 2.], [3., 4.]]);
assert_eq!(*m.as_ref(), [1., 2., 3., 4.]);
source

pub fn from_slice(data: &[T]) -> Self

Creates a matrix from slice.

§Examples
let m = Matrix::<f32, 2, 2>::from_slice(&[1., 2., 3., 4.]);
assert_eq!(*m.as_ref(), [1., 2., 3., 4.]);
source

pub fn columns(&self) -> usize

Returns the number of columns in the matrix.

§Examples
let m = Matrix::<f32, 3, 2>::default();
assert_eq!(m.columns(), 2);
source

pub fn rows(&self) -> usize

Returns the number of rows in the matrix.

§Examples
let m = Matrix::<f32, 3, 2>::default();
assert_eq!(m.rows(), 3);
source§

impl<T: Copy + NumAssign, const N: usize> Matrix<T, N, N>

source

pub fn identity() -> Self

Creates an identity matrix

§Examples
let m = Matrix::<f32, 3, 3>::identity();
assert_eq!(*m.as_ref(), [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]);
source§

impl<T: Copy + NumAssign, const R: usize, const C: usize> Matrix<T, R, C>

source

pub fn mul_assign<const N: usize>( &mut self, lhs: Matrix<T, R, N>, rhs: Matrix<T, N, C> )

Multiplies 2 matrices and stores the result into self.

§Examples
let (m1, m2) = (Matrix::<i32, 3, 2>::from_slice(&[1, 2, 3, 4, 5, 6]), Matrix::<i32, 2, 1>::from_slice(&[7, 8]));
let mut result = Matrix::<i32, 3, 1>::default();
result.mul_assign(m1, m2);
assert_eq!(*result.as_ref(), [39, 54, 69]);
source§

impl<T: Copy + NumAssign, const N: usize> Matrix<T, N, N>

source

pub fn transpose(&mut self)

Transpose the Matrix.

§Examples
let mut m = Matrix::<i32, 3, 3>::from_slice(&[1, 2, 3, 4, 5, 6, 7, 8, 9]);
m.transpose();
assert_eq!(*m.as_ref(), [1, 4, 7, 2, 5, 8, 3, 6, 9]);
source

pub fn transposed(&self) -> Self

Returns the Matrix transposed.

§Examples
let mut m = Matrix::<i32, 3, 3>::from_slice(&[1, 2, 3, 4, 5, 6, 7, 8, 9]);
assert_eq!(*m.transposed().as_ref(), [1, 4, 7, 2, 5, 8, 3, 6, 9]);
source§

impl<T: Copy + NumAssign, const N: usize> Matrix<T, N, 1>

source

pub fn dot(&self, rhs: Self) -> T

Calculates the dot product of 2 column matrices aka vectors.

§Examples
let (v1, v2) = (Matrix::<i32, 3, 1>::from_slice(&[1, 2, 3]), Matrix::<i32, 3, 1>::from_slice(&[4, 5, 6]));
assert_eq!(v1.dot(v2), 32);
source

pub fn sqr_len(&self) -> T

Calculates the square length of a column matrix aka vector.

§Examples
assert_eq!(Matrix::<i32, 3, 1>::from_slice(&[3, 4, 12]).sqr_len(), 169);
source

pub fn lerp(&self, rhs: Self, t: T) -> Self

Linear interpolates between 2 column matrices aka vectors.

§Examples
let (v1, v2) = (Matrix::<f32, 3, 1>::from_slice(&[1., 2., 3.]), Matrix::<f32, 3, 1>::from_slice(&[5., 6., 7.]));
assert_eq!(*v1.lerp(v2, 0.5).as_ref(), [3., 4., 5.]);
source§

impl<T: Copy + FloatOps + NumAssign, const N: usize> Matrix<T, N, 1>

source

pub fn len(&self) -> T

Calculates the length of a column matrix aka vector.

§Examples
assert_eq!(Matrix::<f32, 3, 1>::from_slice(&[3., 4., 12.]).len(), 13.);
source

pub fn normalize(&mut self) -> bool

Normizalizes this column matrix aka vector.

§Examples
let mut v = Matrix::<f32, 2, 1>::from_slice(&[3., 4.]);
assert!(v.normalize());
assert_eq!(*v.as_ref(), [0.6, 0.8]);
source

pub fn normalized(&self) -> Option<Self>

Returns a normalized version of this vector.

§Examples
let mut v = Matrix::<f32, 2, 1>::from_slice(&[3., 4.]);
assert_eq!(v.normalized().unwrap().as_ref(), [0.6, 0.8]);
source§

impl<T: Copy + NumAssign, const R: usize> Matrix<T, R, 1>

source

pub fn from_array(arr: [T; R]) -> Self

Creates a vector from raw array.

§Examples
let v = Vector::<f32, 4>::from_array([1., 2., 3., 4.]);
assert_eq!(*v.as_ref(), [1., 2., 3., 4.]);
source§

impl<T: Copy + NumAssign> Matrix<T, 3, 1>

source

pub fn from_vec2(v: Vec2<T>, z: T) -> Self

Creates a new Vec3 from a Vec2 and z component.

§Examples
let v = Vec2::<i32>::from_slice(&[2, 3]);
assert_eq!(*Vec3::<i32>::from_vec2(v, 4).as_ref(), [2, 3, 4]);
source

pub fn xy(&self) -> Vec2<T>

Returns a copy of the xy components as a Vec2.

§Examples
let v = Vec3::<i32>::from_slice(&[2, 3, 4]);
assert_eq!(*v.xy().as_ref(), [2, 3]);
source§

impl<T: Copy + NumAssign> Matrix<T, 4, 1>

source

pub fn from_vec3(v: Vec3<T>, w: T) -> Self

Creates a new Vec4 from a Vec3 and w component.

§Examples
let v = Vec3::<i32>::from_slice(&[2, 3, 4]);
assert_eq!(*Vec4::<i32>::from_vec3(v, 1).as_ref(), [2, 3, 4, 1]);
source

pub fn xy(&self) -> Vec2<T>

Returns a copy of the xy components as a Vec2.

§Examples
let v = Vec4::<i32>::from_slice(&[1, 2, 3, 4]);
assert_eq!(*v.xy().as_ref(), [1, 2]);
source

pub fn xyz(&self) -> Vec3<T>

Returns a copy of the xyz components as a Vec3.

§Examples
let v = Vec4::<i32>::from_slice(&[1, 2, 3, 4]);
assert_eq!(*v.xyz().as_ref(), [1, 2, 3]);
source§

impl<T: Copy + NumAssign> Matrix<T, 3, 1>

source

pub fn cross(&self, rhs: Self) -> Self

Calculates the cross product of this vector with another vector.

§Examples
let (v1, v2) = (Vec3::<i32>::from_slice(&[2, 3, 4]), Vec3::<i32>::from_slice(&[5, 6, 7]));
assert_eq!(*v1.cross(v2).as_ref(), [-3, 6, -3]);
source§

impl<T: Copy + NumAssign> Matrix<T, 2, 2>

source

pub fn det(&self) -> T

Calculates the determinant of this matrix.

§Examples
let m = Mat2::<i32>::from_slice(&[1, 2, 3, 4]);
assert_eq!(m.det(), -2);
source

pub fn invert(&mut self) -> bool

Invert this matrix. If this matrix is not invertible, this method returns false and the matrix is unchanged.

§Examples
let mut m = <Mat2>::from_slice(&[1., 2., 3., 4.]);
assert!(m.invert());
assert_eq!(*m.as_ref(), [-2., 1., 1.5, -0.5]);
source§

impl<T: Copy + NumAssign> Matrix<T, 3, 3>

source

pub fn det(&self) -> T

Calculates the determinant of this matrix.

§Examples
let m = Mat3::<i32>::from_slice(&[1, 0, 5, 2, 1, 6, 3, 4, 0]);
assert_eq!(m.det(), 1);
source

pub fn invert(&mut self) -> bool

Invert this matrix. If this matrix is not invertible, this method returns false and the matrix is unchanged. For formula, see: https://en.wikipedia.org/wiki/Invertible_matrix#Inversion_of_3_%C3%97_3_matrices

§Examples
let mut m = <Mat3>::from_slice(&[1., 0., 5., 2., 1., 6., 3., 4., 0.]);
assert!(m.invert());
assert_eq!(*m.as_ref(), [-24., 20., -5., 18., -15., 4., 5., -4., 1.]);

let mut m2 = <Mat3>::from_slice(&[1., 0., 1., 0., 1., 0., 0., 0., 0.]);
assert!(!m2.invert());
assert_eq!(*m2.as_ref(), [1., 0., 1., 0., 1., 0., 0., 0., 0.]);
source

pub fn normal_matrix(&mut self) -> bool

Transforms this matrix into a normal matrix, which is the inverse transpose of itself. If this matrix is not invertible, this method returns false and the matrix is unchanged.

§Examples
let mut m = <Mat3>::from_slice(&[0., 0., 1., 1., 0., 0., 0., 1., 0.]);
assert!(m.normal_matrix());
assert_eq!(*m.as_ref(), [0., 0., 1., 1., 0., 0., 0., 1., 0.]);
source§

impl<T: Copy + NumAssign> Matrix<T, 4, 4>

source

pub fn det(&self) -> T

Calculates the determinant of this matrix.

§Examples
let m = Mat4::<i32>::from_slice(&[1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, 1]);
assert_eq!(m.det(), -16);
source

pub fn invert(&mut self) -> bool

Invert this matrix. If this matrix is not invertible, this method returns false and the matrix is unchanged.

§Examples
let mut m = <Mat4>::from_slice(&[1., 1., 1., -1., 1., 1., -1., 1., 1., -1., 1., 1., -1., 1., 1., 1.]);
assert!(m.invert());
assert_eq!(*m.as_ref(), [0.25, 0.25, 0.25, -0.25, 0.25, 0.25, -0.25, 0.25, 0.25, -0.25, 0.25, 0.25, -0.25, 0.25, 0.25, 0.25]);

Trait Implementations§

source§

impl<T: Copy + NumAssign, const R: usize, const C: usize> Add for Matrix<T, R, C>

§

type Output = Matrix<T, R, C>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Matrix<T, R, C>) -> Self::Output

Performs the + operation. Read more
source§

impl<T: Copy + NumAssign, const R: usize, const C: usize> AddAssign for Matrix<T, R, C>

source§

fn add_assign(&mut self, rhs: Matrix<T, R, C>)

Performs the += operation. Read more
source§

impl<T: Copy + NumAssign, const R: usize, const C: usize> AsMut<[T]> for Matrix<T, R, C>

source§

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

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

impl<T: Copy + NumAssign, const R: usize, const C: usize> AsRef<[T]> for Matrix<T, R, C>

source§

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

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

impl<T: Clone + Copy + NumAssign, const R: usize, const C: usize> Clone for Matrix<T, R, C>

source§

fn clone(&self) -> Matrix<T, R, C>

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 + Copy + NumAssign, const R: usize, const C: usize> Debug for Matrix<T, R, C>

source§

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

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

impl<T: Copy + NumAssign, const R: usize, const C: usize> Default for Matrix<T, R, C>

source§

fn default() -> Self

Creates a zero matrix.

§Examples
let m = Matrix::<f32, 3, 3>::default();
assert_eq!(*m.as_ref(), [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]);
source§

impl<'de, T, const R: usize, const C: usize> Deserialize<'de> for Matrix<T, R, C>
where T: Deserialize<'de> + Copy + NumAssign,

source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
source§

impl<T: Copy + NumAssign, const R: usize, const C: usize> Div<T> for Matrix<T, R, C>

§

type Output = Matrix<T, R, C>

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl<T: Copy + NumAssign, const R: usize, const C: usize> DivAssign<T> for Matrix<T, R, C>

source§

fn div_assign(&mut self, rhs: T)

Performs the /= operation. Read more
source§

impl<T: Copy + FloatEq<T> + NumAssign, const R: usize, const C: usize> FloatEq<T> for Matrix<T, R, C>

source§

fn float_eq(&self, rhs: Self, epsilon: T) -> bool

Checks if self equals to RHS within an epsilon. Read more
source§

impl<T: Copy + NumAssign, const R: usize, const C: usize> From<&[T]> for Matrix<T, R, C>

source§

fn from(slice: &[T]) -> Self

Converts to this type from the input type.
source§

impl<T: Copy + NumAssign, const R: usize, const C: usize> From<[[T; R]; C]> for Matrix<T, R, C>

source§

fn from(data: [[T; R]; C]) -> Self

Converts to this type from the input type.
source§

impl<T: Copy + NumAssign> From<Matrix<T, 2, 1>> for Vec3<T>

source§

fn from(v: Vec2<T>) -> Self

Augments a Vec2 into a Vec3 The resulting Vec3 contains the given Vec2 with z = 1.

§Examples
let v = Vec3::from(Vec2::<i32>::from_slice(&[2, 3]));
assert_eq!(*v.as_ref(), [2, 3, 1]);
source§

impl<T: Copy + NumAssign> From<Matrix<T, 2, 2>> for Mat3<T>

source§

fn from(m: Mat2<T>) -> Self

Augments a Mat2 into a Mat3 The resulting Mat3 contains the given Mat2 on upper-left with the lower-right element = 1.

§Examples
let m = Mat3::from(Mat2::<i32>::from_slice(&[2, 3, 4, 5]));
assert_eq!(*m.as_ref(), [2, 3, 0, 4, 5, 0, 0, 0, 1]);
source§

impl<T: Copy + NumAssign> From<Matrix<T, 3, 1>> for Vec2<T>

source§

fn from(v: Vec3<T>) -> Self

Creates a Vec2 from the (x, y) of a Vec3

§Examples
let v = Vec2::from(Vec3::<i32>::from_slice(&[2, 3, 4]));
assert_eq!(*v.as_ref(), [2, 3]);
source§

impl<T: Copy + NumAssign> From<Matrix<T, 3, 1>> for Vec4<T>

source§

fn from(v: Vec3<T>) -> Self

Augments a Vec3 into a Vec4 The resulting Vec4 contains the given Vec3 with w = 1.

§Examples
let v = Vec4::from(Vec3::<i32>::from_slice(&[2, 3, 4]));
assert_eq!(*v.as_ref(), [2, 3, 4, 1]);
source§

impl<T: Copy + NumAssign> From<Matrix<T, 3, 1>> for Quaternion<T>

source§

fn from(v: Vec3<T>) -> Self

Creates a Quaternion from a Vec3 using w = 0.

§Examples
let q = Quaternion::from(Vec3::<i32>::from_slice(&[2, 3, 4]));
assert_eq!(*q.as_ref(), [2, 3, 4, 0]);
source§

impl<T: Copy + NumAssign> From<Matrix<T, 3, 3>> for Mat2<T>

source§

fn from(m: Mat3<T>) -> Self

Creates a Mat2 from the upper-left 2x2 of a Mat3

§Examples
let m = Mat2::from(Mat3::<i32>::from_slice(&[2, 3, 4, 5, 6, 7, 8, 9, 1]));
assert_eq!(*m.as_ref(), [2, 3, 5, 6]);
source§

impl<T: Copy + NumAssign> From<Matrix<T, 3, 3>> for Mat4<T>

source§

fn from(m: Mat3<T>) -> Self

Augments a Mat3 into a Mat4 The resulting Mat4 contains the given Mat3 on upper-left with the lower-right element = 1.

§Examples
let m = Mat4::from(Mat3::<i32>::from_slice(&[2, 3, 4, 5, 6, 7, 8, 9, 10]));
assert_eq!(*m.as_ref(), [2, 3, 4, 0, 5, 6, 7, 0, 8, 9, 10, 0, 0, 0, 0, 1]);
source§

impl<T: Copy + NumAssign> From<Matrix<T, 4, 1>> for Vec3<T>

source§

fn from(v: Vec4<T>) -> Self

Creates a Vec3 from the (x, y, z) of a Vec4

§Examples
let v = Vec3::from(Vec4::<i32>::from_slice(&[2, 3, 4, 1]));
assert_eq!(*v.as_ref(), [2, 3, 4]);
source§

impl<T: Copy + NumAssign> From<Matrix<T, 4, 4>> for Mat3<T>

source§

fn from(m: Mat4<T>) -> Self

Creates a Mat3 from the upper-left 3x3 of a Mat4

§Examples
let m = Mat3::from(Mat4::<i32>::from_slice(&[2, 3, 4, 11, 5, 6, 7, 12, 8, 9, 10, 13, 14, 15, 0, 1]));
assert_eq!(*m.as_ref(), [2, 3, 4, 5, 6, 7, 8, 9, 10]);
source§

impl<T: Copy + NumAssign, const R: usize> From<Matrix<T, R, 1>> for [T; R]

source§

fn from(v: Vector<T, R>) -> Self

Converts to this type from the input type.
source§

impl<T: Copy + NumAssign, const R: usize, const C: usize> From<Matrix<T, R, C>> for [[T; R]; C]

source§

fn from(m: Matrix<T, R, C>) -> Self

Converts to this type from the input type.
source§

impl<T: Copy + NumAssign, const R: usize, const C: usize> Index<(usize, usize)> for Matrix<T, R, C>

source§

fn index(&self, (row, col): (usize, usize)) -> &Self::Output

Indexing into the Matrix by (row, column).

§

type Output = T

The returned type after indexing.
source§

impl<T: Copy + NumAssign, const R: usize, const C: usize> Index<usize> for Matrix<T, R, C>

§

type Output = T

The returned type after indexing.
source§

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

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

impl<T: Copy + NumAssign, const R: usize, const C: usize> IndexMut<(usize, usize)> for Matrix<T, R, C>

source§

fn index_mut(&mut self, (row, col): (usize, usize)) -> &mut Self::Output

Mutably indexing into the Matrix by (row, column).

source§

impl<T: Copy + NumAssign, const R: usize, const C: usize> IndexMut<usize> for Matrix<T, R, C>

source§

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

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

impl<T: Copy + NumAssign, const R: usize, const N: usize, const C: usize> Mul<Matrix<T, N, C>> for Matrix<T, R, N>

§

type Output = Matrix<T, R, C>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Matrix<T, N, C>) -> Self::Output

Performs the * operation. Read more
source§

impl<T: Copy + NumAssign, const R: usize, const C: usize> Mul<T> for Matrix<T, R, C>

§

type Output = Matrix<T, R, C>

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl<T: Copy + NumAssign, const R: usize, const C: usize> MulAssign<T> for Matrix<T, R, C>

source§

fn mul_assign(&mut self, rhs: T)

Performs the *= operation. Read more
source§

impl<T: Copy + NumAssign, const N: usize> MulAssign for Matrix<T, N, N>

source§

fn mul_assign(&mut self, rhs: Matrix<T, N, N>)

Performs the *= operation. Read more
source§

impl<T: Copy + NumAssign, const N: usize> One for Matrix<T, N, N>

source§

fn one() -> Self

Returns the multiplicative identity element of Self, 1. Read more
source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
source§

fn is_one(&self) -> bool
where Self: PartialEq,

Returns true if self is equal to the multiplicative identity. Read more
source§

impl<T: PartialEq + Copy + NumAssign, const R: usize, const C: usize> PartialEq for Matrix<T, R, C>

source§

fn eq(&self, other: &Matrix<T, R, C>) -> 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: Copy + NumAssign, const R: usize, const C: usize> Rem<T> for Matrix<T, R, C>

§

type Output = Matrix<T, R, C>

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

impl<T: Copy + NumAssign, const R: usize, const C: usize> RemAssign<T> for Matrix<T, R, C>

source§

fn rem_assign(&mut self, rhs: T)

Performs the %= operation. Read more
source§

impl<T, const R: usize, const C: usize> Serialize for Matrix<T, R, C>
where T: Serialize + Copy + NumAssign,

source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
source§

impl<T: Copy + NumAssign, const R: usize, const C: usize> Sub for Matrix<T, R, C>

§

type Output = Matrix<T, R, C>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Matrix<T, R, C>) -> Self::Output

Performs the - operation. Read more
source§

impl<T: Copy + NumAssign, const R: usize, const C: usize> SubAssign for Matrix<T, R, C>

source§

fn sub_assign(&mut self, rhs: Matrix<T, R, C>)

Performs the -= operation. Read more
source§

impl<T: Copy + NumAssign, const R: usize, const C: usize> Zero for Matrix<T, R, C>

source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
source§

impl<T: Copy + Copy + NumAssign, const R: usize, const C: usize> Copy for Matrix<T, R, C>

source§

impl<T: Copy + NumAssign, const R: usize, const C: usize> StructuralPartialEq for Matrix<T, R, C>

Auto Trait Implementations§

§

impl<T, const R: usize, const C: usize> Freeze for Matrix<T, R, C>
where T: Freeze,

§

impl<T, const R: usize, const C: usize> RefUnwindSafe for Matrix<T, R, C>
where T: RefUnwindSafe,

§

impl<T, const R: usize, const C: usize> Send for Matrix<T, R, C>
where T: Send,

§

impl<T, const R: usize, const C: usize> Sync for Matrix<T, R, C>
where T: Sync,

§

impl<T, const R: usize, const C: usize> Unpin for Matrix<T, R, C>
where T: Unpin,

§

impl<T, const R: usize, const C: usize> UnwindSafe for Matrix<T, R, C>
where 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> 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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,