Skip to main content

Mat4

Struct Mat4 

Source
#[repr(C)]
pub struct Mat4 { pub x_axis: Vec4, pub y_axis: Vec4, pub z_axis: Vec4, pub w_axis: Vec4, }
Expand description

A 4x4 column major matrix.

This 4x4 matrix type features convenience methods for creating and using affine transforms and perspective projections. If you are primarily dealing with 3D affine transformations considering using Affine3A which is faster than a 4x4 matrix for some affine operations.

Affine transformations including 3D translation, rotation and scale can be created using methods such as Self::from_translation(), Self::from_quat(), Self::from_scale() and Self::from_scale_rotation_translation().

Orthographic projections can be created using the methods Self::orthographic_lh() for left-handed coordinate systems and Self::orthographic_rh() for right-handed systems. The resulting matrix is also an affine transformation.

The Self::transform_point3() and Self::transform_vector3() convenience methods are provided for performing affine transformations on 3D vectors and points. These multiply 3D inputs as 4D vectors with an implicit w value of 1 for points and 0 for vectors respectively. These methods assume that Self contains a valid affine transform.

Perspective projections can be created using methods such as Self::perspective_lh(), Self::perspective_infinite_lh() and Self::perspective_infinite_reverse_lh() for left-handed co-ordinate systems and Self::perspective_rh(), Self::perspective_infinite_rh() and Self::perspective_infinite_reverse_rh() for right-handed co-ordinate systems.

The resulting perspective project can be use to transform 3D vectors as points with perspective correction using the Self::project_point3() convenience method.

Fields§

§x_axis: Vec4§y_axis: Vec4§z_axis: Vec4§w_axis: Vec4

Implementations§

Source§

impl Mat4

Source

pub const ZERO: Mat4

A 4x4 matrix with all elements set to 0.0.

Source

pub const IDENTITY: Mat4

A 4x4 identity matrix, where all diagonal elements are 1, and all off-diagonal elements are 0.

Source

pub const NAN: Mat4

All NAN:s.

Source

pub const fn from_cols( x_axis: Vec4, y_axis: Vec4, z_axis: Vec4, w_axis: Vec4, ) -> Mat4

Creates a 4x4 matrix from four column vectors.

Source

pub const fn from_cols_array(m: &[f32; 16]) -> Mat4

Creates a 4x4 matrix from a [f32; 16] array stored in column major order. If your data is stored in row major you will need to transpose the returned matrix.

Source

pub const fn to_cols_array(&self) -> [f32; 16]

Creates a [f32; 16] array storing data in column major order. If you require data in row major order transpose the matrix first.

Source

pub const fn from_cols_array_2d(m: &[[f32; 4]; 4]) -> Mat4

Creates a 4x4 matrix from a [[f32; 4]; 4] 4D array stored in column major order. If your data is in row major order you will need to transpose the returned matrix.

Source

pub const fn to_cols_array_2d(&self) -> [[f32; 4]; 4]

Creates a [[f32; 4]; 4] 4D array storing data in column major order. If you require data in row major order transpose the matrix first.

Source

pub const fn from_diagonal(diagonal: Vec4) -> Mat4

Creates a 4x4 matrix with its diagonal set to diagonal and all other entries set to 0.

Source

pub fn from_scale_rotation_translation( scale: Vec3, rotation: Quat, translation: Vec3, ) -> Mat4

Creates an affine transformation matrix from the given 3D scale, rotation and translation.

The resulting matrix can be used to transform 3D points and vectors. See Self::transform_point3() and Self::transform_vector3().

§Panics

Will panic if rotation is not normalized when glam_assert is enabled.

Source

pub fn from_rotation_translation(rotation: Quat, translation: Vec3) -> Mat4

Creates an affine transformation matrix from the given 3D translation.

The resulting matrix can be used to transform 3D points and vectors. See Self::transform_point3() and Self::transform_vector3().

§Panics

Will panic if rotation is not normalized when glam_assert is enabled.

Source

pub fn to_scale_rotation_translation(&self) -> (Vec3, Quat, Vec3)

Extracts scale, rotation and translation from self. The input matrix is expected to be a 3D affine transformation matrix otherwise the output will be invalid.

§Panics

Will panic if the determinant of self is zero or if the resulting scale vector contains any zero elements when glam_assert is enabled.

Source

pub fn from_quat(rotation: Quat) -> Mat4

Creates an affine transformation matrix from the given rotation quaternion.

The resulting matrix can be used to transform 3D points and vectors. See Self::transform_point3() and Self::transform_vector3().

§Panics

Will panic if rotation is not normalized when glam_assert is enabled.

Source

pub fn from_mat3(m: Mat3) -> Mat4

Creates an affine transformation matrix from the given 3x3 linear transformation matrix.

The resulting matrix can be used to transform 3D points and vectors. See Self::transform_point3() and Self::transform_vector3().

Source

pub fn from_mat3_translation(mat3: Mat3, translation: Vec3) -> Mat4

Creates an affine transformation matrics from a 3x3 matrix (expressing scale, shear and rotation) and a translation vector.

Equivalent to Mat4::from_translation(translation) * Mat4::from_mat3(mat3)

Source

pub fn from_mat3a(m: Mat3A) -> Mat4

Creates an affine transformation matrix from the given 3x3 linear transformation matrix.

The resulting matrix can be used to transform 3D points and vectors. See Self::transform_point3() and Self::transform_vector3().

Source

pub fn from_translation(translation: Vec3) -> Mat4

Creates an affine transformation matrix from the given 3D translation.

The resulting matrix can be used to transform 3D points and vectors. See Self::transform_point3() and Self::transform_vector3().

Source

pub fn from_axis_angle(axis: Vec3, angle: f32) -> Mat4

Creates an affine transformation matrix containing a 3D rotation around a normalized rotation axis of angle (in radians).

The resulting matrix can be used to transform 3D points and vectors. See Self::transform_point3() and Self::transform_vector3().

§Panics

Will panic if axis is not normalized when glam_assert is enabled.

Source

pub fn from_euler(order: EulerRot, a: f32, b: f32, c: f32) -> Mat4

Creates a affine transformation matrix containing a rotation from the given euler rotation sequence and angles (in radians).

The resulting matrix can be used to transform 3D points and vectors. See Self::transform_point3() and Self::transform_vector3().

Source

pub fn to_euler(&self, order: EulerRot) -> (f32, f32, f32)

Extract Euler angles with the given Euler rotation order.

Note if the upper 3x3 matrix contain scales, shears, or other non-rotation transformations then the resulting Euler angles will be ill-defined.

§Panics

Will panic if any column of the upper 3x3 rotation matrix is not normalized when glam_assert is enabled.

Source

pub fn from_rotation_x(angle: f32) -> Mat4

Creates an affine transformation matrix containing a 3D rotation around the x axis of angle (in radians).

The resulting matrix can be used to transform 3D points and vectors. See Self::transform_point3() and Self::transform_vector3().

Source

pub fn from_rotation_y(angle: f32) -> Mat4

Creates an affine transformation matrix containing a 3D rotation around the y axis of angle (in radians).

The resulting matrix can be used to transform 3D points and vectors. See Self::transform_point3() and Self::transform_vector3().

Source

pub fn from_rotation_z(angle: f32) -> Mat4

Creates an affine transformation matrix containing a 3D rotation around the z axis of angle (in radians).

The resulting matrix can be used to transform 3D points and vectors. See Self::transform_point3() and Self::transform_vector3().

Source

pub fn from_scale(scale: Vec3) -> Mat4

Creates an affine transformation matrix containing the given 3D non-uniform scale.

The resulting matrix can be used to transform 3D points and vectors. See Self::transform_point3() and Self::transform_vector3().

§Panics

Will panic if all elements of scale are zero when glam_assert is enabled.

Source

pub const fn from_cols_slice(slice: &[f32]) -> Mat4

Creates a 4x4 matrix from the first 16 values in slice.

§Panics

Panics if slice is less than 16 elements long.

Source

pub fn write_cols_to_slice(&self, slice: &mut [f32])

Writes the columns of self to the first 16 elements in slice.

§Panics

Panics if slice is less than 16 elements long.

Source

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

Returns the matrix column for the given index.

§Panics

Panics if index is greater than 3.

Source

pub fn col_mut(&mut self, index: usize) -> &mut Vec4

Returns a mutable reference to the matrix column for the given index.

§Panics

Panics if index is greater than 3.

Source

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

Returns the matrix row for the given index.

§Panics

Panics if index is greater than 3.

Source

pub fn is_finite(&self) -> bool

Returns true if, and only if, all elements are finite. If any element is either NaN, positive or negative infinity, this will return false.

Source

pub fn is_nan(&self) -> bool

Returns true if any elements are NaN.

Source

pub fn transpose(&self) -> Mat4

Returns the transpose of self.

Source

pub fn diagonal(&self) -> Vec4

Returns the diagonal of self.

Source

pub fn determinant(&self) -> f32

Returns the determinant of self.

Source

pub fn inverse(&self) -> Mat4

Returns the inverse of self.

If the matrix is not invertible the returned matrix will be invalid.

§Panics

Will panic if the determinant of self is zero when glam_assert is enabled.

Source

pub fn try_inverse(&self) -> Option<Mat4>

Returns the inverse of self or None if the matrix is not invertible.

Source

pub fn inverse_or_zero(&self) -> Mat4

Returns the inverse of self or Mat4::ZERO if the matrix is not invertible.

Source

pub fn look_to_lh(eye: Vec3, dir: Vec3, up: Vec3) -> Mat4

Creates a left-handed view matrix using a camera position, a facing direction and an up direction

For a view coordinate system with +X=right, +Y=up and +Z=forward.

§Panics

Will panic if dir or up are not normalized when glam_assert is enabled.

Source

pub fn look_to_rh(eye: Vec3, dir: Vec3, up: Vec3) -> Mat4

Creates a right-handed view matrix using a camera position, a facing direction, and an up direction.

For a view coordinate system with +X=right, +Y=up and +Z=back.

§Panics

Will panic if dir or up are not normalized when glam_assert is enabled.

Source

pub fn look_at_lh(eye: Vec3, center: Vec3, up: Vec3) -> Mat4

Creates a left-handed view matrix using a camera position, a focal points and an up direction.

For a view coordinate system with +X=right, +Y=up and +Z=forward.

§Panics

Will panic if up is not normalized when glam_assert is enabled.

Source

pub fn look_at_rh(eye: Vec3, center: Vec3, up: Vec3) -> Mat4

Creates a right-handed view matrix using a camera position, a focal point, and an up direction.

For a view coordinate system with +X=right, +Y=up and +Z=back.

§Panics

Will panic if up is not normalized when glam_assert is enabled.

Source

pub fn frustum_rh_gl( left: f32, right: f32, bottom: f32, top: f32, z_near: f32, z_far: f32, ) -> Mat4

Creates a right-handed perspective projection matrix with [-1,1] depth range.

This is the same as the OpenGL glFrustum function.

See https://registry.khronos.org/OpenGL-Refpages/gl2.1/xhtml/glFrustum.xml

Source

pub fn frustum_lh( left: f32, right: f32, bottom: f32, top: f32, z_near: f32, z_far: f32, ) -> Mat4

Creates a left-handed perspective projection matrix with [0,1] depth range.

§Panics

Will panic if z_near or z_far are less than or equal to zero when glam_assert is enabled.

Source

pub fn frustum_rh( left: f32, right: f32, bottom: f32, top: f32, z_near: f32, z_far: f32, ) -> Mat4

Creates a right-handed perspective projection matrix with [0,1] depth range.

§Panics

Will panic if z_near or z_far are less than or equal to zero when glam_assert is enabled.

Source

pub fn perspective_rh_gl( fov_y_radians: f32, aspect_ratio: f32, z_near: f32, z_far: f32, ) -> Mat4

Creates a right-handed perspective projection matrix with [-1,1] depth range.

Useful to map the standard right-handed coordinate system into what OpenGL expects.

This is the same as the OpenGL gluPerspective function. See https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluPerspective.xml

Source

pub fn perspective_lh( fov_y_radians: f32, aspect_ratio: f32, z_near: f32, z_far: f32, ) -> Mat4

Creates a left-handed perspective projection matrix with [0,1] depth range.

Useful to map the standard left-handed coordinate system into what WebGPU/Metal/Direct3D expect.

§Panics

Will panic if z_near or z_far are less than or equal to zero when glam_assert is enabled.

Source

pub fn perspective_rh( fov_y_radians: f32, aspect_ratio: f32, z_near: f32, z_far: f32, ) -> Mat4

Creates a right-handed perspective projection matrix with [0,1] depth range.

Useful to map the standard right-handed coordinate system into what WebGPU/Metal/Direct3D expect.

§Panics

Will panic if z_near or z_far are less than or equal to zero when glam_assert is enabled.

Source

pub fn perspective_infinite_lh( fov_y_radians: f32, aspect_ratio: f32, z_near: f32, ) -> Mat4

Creates an infinite left-handed perspective projection matrix with [0,1] depth range.

Like perspective_lh, but with an infinite value for z_far. The result is that points near z_near are mapped to depth 0, and as they move towards infinity the depth approaches 1.

§Panics

Will panic if z_near or z_far are less than or equal to zero when glam_assert is enabled.

Source

pub fn perspective_infinite_reverse_lh( fov_y_radians: f32, aspect_ratio: f32, z_near: f32, ) -> Mat4

Creates an infinite reverse left-handed perspective projection matrix with [0,1] depth range.

Similar to perspective_infinite_lh, but maps Z = z_near to a depth of 1 and Z = infinity to a depth of 0.

§Panics

Will panic if z_near is less than or equal to zero when glam_assert is enabled.

Source

pub fn perspective_infinite_rh( fov_y_radians: f32, aspect_ratio: f32, z_near: f32, ) -> Mat4

Creates an infinite right-handed perspective projection matrix with [0,1] depth range.

Like perspective_rh, but with an infinite value for z_far. The result is that points near z_near are mapped to depth 0, and as they move towards infinity the depth approaches 1.

§Panics

Will panic if z_near or z_far are less than or equal to zero when glam_assert is enabled.

Source

pub fn perspective_infinite_reverse_rh( fov_y_radians: f32, aspect_ratio: f32, z_near: f32, ) -> Mat4

Creates an infinite reverse right-handed perspective projection matrix with [0,1] depth range.

Similar to perspective_infinite_rh, but maps Z = z_near to a depth of 1 and Z = infinity to a depth of 0.

§Panics

Will panic if z_near is less than or equal to zero when glam_assert is enabled.

Source

pub fn orthographic_rh_gl( left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32, ) -> Mat4

Creates a right-handed orthographic projection matrix with [-1,1] depth range. This is the same as the OpenGL glOrtho function in OpenGL. See https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glOrtho.xml

Useful to map a right-handed coordinate system to the normalized device coordinates that OpenGL expects.

Source

pub fn orthographic_lh( left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32, ) -> Mat4

Creates a left-handed orthographic projection matrix with [0,1] depth range.

Useful to map a left-handed coordinate system to the normalized device coordinates that WebGPU/Direct3D/Metal expect.

Source

pub fn orthographic_rh( left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32, ) -> Mat4

Creates a right-handed orthographic projection matrix with [0,1] depth range.

Useful to map a right-handed coordinate system to the normalized device coordinates that WebGPU/Direct3D/Metal expect.

Source

pub fn project_point3(&self, rhs: Vec3) -> Vec3

Transforms the given 3D vector as a point, applying perspective correction.

This is the equivalent of multiplying the 3D vector as a 4D vector where w is 1.0. The perspective divide is performed meaning the resulting 3D vector is divided by w.

This method assumes that self contains a projective transform.

Source

pub fn transform_point3(&self, rhs: Vec3) -> Vec3

Transforms the given 3D vector as a point.

This is the equivalent of multiplying the 3D vector as a 4D vector where w is 1.0.

This method assumes that self contains a valid affine transform. It does not perform a perspective divide, if self contains a perspective transform, or if you are unsure, the Self::project_point3() method should be used instead.

§Panics

Will panic if the 3rd row of self is not (0, 0, 0, 1) when glam_assert is enabled.

Source

pub fn transform_vector3(&self, rhs: Vec3) -> Vec3

Transforms the give 3D vector as a direction.

This is the equivalent of multiplying the 3D vector as a 4D vector where w is 0.0.

This method assumes that self contains a valid affine transform.

§Panics

Will panic if the 3rd row of self is not (0, 0, 0, 1) when glam_assert is enabled.

Source

pub fn project_point3a(&self, rhs: Vec3A) -> Vec3A

Transforms the given Vec3A as a 3D point, applying perspective correction.

This is the equivalent of multiplying the Vec3A as a 4D vector where w is 1.0. The perspective divide is performed meaning the resulting 3D vector is divided by w.

This method assumes that self contains a projective transform.

Source

pub fn transform_point3a(&self, rhs: Vec3A) -> Vec3A

Transforms the given Vec3A as 3D point.

This is the equivalent of multiplying the Vec3A as a 4D vector where w is 1.0.

Source

pub fn transform_vector3a(&self, rhs: Vec3A) -> Vec3A

Transforms the give Vec3A as 3D vector.

This is the equivalent of multiplying the Vec3A as a 4D vector where w is 0.0.

Source

pub fn mul_vec4(&self, rhs: Vec4) -> Vec4

Transforms a 4D vector.

Source

pub fn mul_transpose_vec4(&self, rhs: Vec4) -> Vec4

Transforms a 4D vector by the transpose of self.

Source

pub fn mul_mat4(&self, rhs: &Mat4) -> Mat4

Multiplies two 4x4 matrices.

Source

pub fn add_mat4(&self, rhs: &Mat4) -> Mat4

Adds two 4x4 matrices.

Source

pub fn sub_mat4(&self, rhs: &Mat4) -> Mat4

Subtracts two 4x4 matrices.

Source

pub fn mul_scalar(&self, rhs: f32) -> Mat4

Multiplies a 4x4 matrix by a scalar.

Source

pub fn mul_diagonal_scale(&self, scale: Vec4) -> Mat4

Multiply self by a scaling vector scale. This is faster than creating a whole diagonal scaling matrix and then multiplying that. This operation is commutative.

Source

pub fn div_scalar(&self, rhs: f32) -> Mat4

Divides a 4x4 matrix by a scalar.

Source

pub fn recip(&self) -> Mat4

Returns a matrix containing the reciprocal 1.0/n of each element of self.

Source

pub fn abs_diff_eq(&self, rhs: Mat4, max_abs_diff: f32) -> bool

Returns true if the absolute difference of all elements between self and rhs is less than or equal to max_abs_diff.

This can be used to compare if two matrices contain similar elements. It works best when comparing with a known value. The max_abs_diff that should be used used depends on the values being compared against.

For more see comparing floating point numbers.

Source

pub fn abs(&self) -> Mat4

Takes the absolute value of each element in self

Source

pub fn as_dmat4(&self) -> DMat4

Trait Implementations§

Source§

impl Add<&Mat4> for &Mat4

Source§

type Output = Mat4

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Mat4) -> Mat4

Performs the + operation. Read more
Source§

impl Add<&Mat4> for Mat4

Source§

type Output = Mat4

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Mat4) -> Mat4

Performs the + operation. Read more
Source§

impl Add<Mat4> for &Mat4

Source§

type Output = Mat4

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Mat4) -> Mat4

Performs the + operation. Read more
Source§

impl Add for Mat4

Source§

type Output = Mat4

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Mat4) -> Mat4

Performs the + operation. Read more
Source§

impl AddAssign<&Mat4> for Mat4

Source§

fn add_assign(&mut self, rhs: &Mat4)

Performs the += operation. Read more
Source§

impl AddAssign for Mat4

Source§

fn add_assign(&mut self, rhs: Mat4)

Performs the += operation. Read more
Source§

impl Archive for Mat4

Source§

type Archived = Mat4

The archived representation of this type. Read more
Source§

type Resolver = ()

The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.
Source§

fn resolve( &self, _: <Mat4 as Archive>::Resolver, out: Place<<Mat4 as Archive>::Archived>, )

Creates the archived version of this value at the given position and writes it to the given output. Read more
Source§

const COPY_OPTIMIZATION: CopyOptimization<Self> = _

An optimization flag that allows the bytes of this type to be copied directly to a writer instead of calling serialize. Read more
Source§

impl AsMut<[f32; 16]> for Mat4

Source§

fn as_mut(&mut self) -> &mut [f32; 16]

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

impl AsRef<[f32; 16]> for Mat4

Source§

fn as_ref(&self) -> &[f32; 16]

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

impl<C> CheckBytes<C> for Mat4
where C: Fallible + ?Sized,

Source§

unsafe fn check_bytes( _value: *const Mat4, _: &mut C, ) -> Result<(), <C as Fallible>::Error>

Checks whether the given pointer points to a valid value within the given context. Read more
Source§

impl Clone for Mat4

Source§

fn clone(&self) -> Mat4

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Mat4

Source§

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

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

impl Default for Mat4

Source§

fn default() -> Mat4

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

impl<'de> Deserialize<'de> for Mat4

Deserialize expects a sequence of 16 values.

Source§

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

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

impl<D> Deserialize<Mat4, D> for Mat4
where D: Fallible + ?Sized,

Source§

fn deserialize(&self, _: &mut D) -> Result<Mat4, <D as Fallible>::Error>

Deserializes using the given deserializer
Source§

impl Display for Mat4

Source§

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

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

impl Div<&f32> for &Mat4

Source§

type Output = Mat4

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &f32) -> Mat4

Performs the / operation. Read more
Source§

impl Div<&f32> for Mat4

Source§

type Output = Mat4

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &f32) -> Mat4

Performs the / operation. Read more
Source§

impl Div<f32> for &Mat4

Source§

type Output = Mat4

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f32) -> Mat4

Performs the / operation. Read more
Source§

impl Div<f32> for Mat4

Source§

type Output = Mat4

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f32) -> Mat4

Performs the / operation. Read more
Source§

impl DivAssign<&f32> for Mat4

Source§

fn div_assign(&mut self, rhs: &f32)

Performs the /= operation. Read more
Source§

impl DivAssign<f32> for Mat4

Source§

fn div_assign(&mut self, rhs: f32)

Performs the /= operation. Read more
Source§

impl From<Affine3> for Mat4

Source§

fn from(m: Affine3) -> Mat4

Converts to this type from the input type.
Source§

impl From<Affine3A> for Mat4

Source§

fn from(m: Affine3A) -> Mat4

Converts to this type from the input type.
Source§

impl From<ColumnMatrix4<f32>> for Mat4

Source§

fn from(m: ColumnMatrix4<f32>) -> Mat4

Converts to this type from the input type.
Source§

impl From<RowMatrix4<f32>> for Mat4

Source§

fn from(m: RowMatrix4<f32>) -> Mat4

Converts to this type from the input type.
Source§

impl IntoMint for Mat4

Source§

type MintType = ColumnMatrix4<f32>

The mint type that this type is associated with.
Source§

impl Mul<&Affine3> for &Mat4

Source§

type Output = Mat4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Affine3) -> Mat4

Performs the * operation. Read more
Source§

impl Mul<&Affine3> for Mat4

Source§

type Output = Mat4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Affine3) -> Mat4

Performs the * operation. Read more
Source§

impl Mul<&Affine3A> for &Mat4

Source§

type Output = Mat4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Affine3A) -> Mat4

Performs the * operation. Read more
Source§

impl Mul<&Affine3A> for Mat4

Source§

type Output = Mat4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Affine3A) -> Mat4

Performs the * operation. Read more
Source§

impl Mul<&Mat4> for &Mat4

Source§

type Output = Mat4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Mat4) -> Mat4

Performs the * operation. Read more
Source§

impl Mul<&Mat4> for Mat4

Source§

type Output = Mat4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Mat4) -> Mat4

Performs the * operation. Read more
Source§

impl Mul<&Vec4> for &Mat4

Source§

type Output = Vec4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Vec4) -> Vec4

Performs the * operation. Read more
Source§

impl Mul<&Vec4> for Mat4

Source§

type Output = Vec4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Vec4) -> Vec4

Performs the * operation. Read more
Source§

impl Mul<&f32> for &Mat4

Source§

type Output = Mat4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &f32) -> Mat4

Performs the * operation. Read more
Source§

impl Mul<&f32> for Mat4

Source§

type Output = Mat4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &f32) -> Mat4

Performs the * operation. Read more
Source§

impl Mul<Affine3> for &Mat4

Source§

type Output = Mat4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Affine3) -> Mat4

Performs the * operation. Read more
Source§

impl Mul<Affine3> for Mat4

Source§

type Output = Mat4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Affine3) -> Mat4

Performs the * operation. Read more
Source§

impl Mul<Affine3A> for &Mat4

Source§

type Output = Mat4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Affine3A) -> Mat4

Performs the * operation. Read more
Source§

impl Mul<Affine3A> for Mat4

Source§

type Output = Mat4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Affine3A) -> Mat4

Performs the * operation. Read more
Source§

impl Mul<Mat4> for &Mat4

Source§

type Output = Mat4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Mat4) -> Mat4

Performs the * operation. Read more
Source§

impl Mul<Vec4> for &Mat4

Source§

type Output = Vec4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vec4) -> Vec4

Performs the * operation. Read more
Source§

impl Mul<Vec4> for Mat4

Source§

type Output = Vec4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vec4) -> <Mat4 as Mul<Vec4>>::Output

Performs the * operation. Read more
Source§

impl Mul<f32> for &Mat4

Source§

type Output = Mat4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f32) -> Mat4

Performs the * operation. Read more
Source§

impl Mul<f32> for Mat4

Source§

type Output = Mat4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f32) -> Mat4

Performs the * operation. Read more
Source§

impl Mul for Mat4

Source§

type Output = Mat4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Mat4) -> Mat4

Performs the * operation. Read more
Source§

impl MulAssign<&Affine3> for Mat4

Source§

fn mul_assign(&mut self, rhs: &Affine3)

Performs the *= operation. Read more
Source§

impl MulAssign<&Affine3A> for Mat4

Source§

fn mul_assign(&mut self, rhs: &Affine3A)

Performs the *= operation. Read more
Source§

impl MulAssign<&Mat4> for Mat4

Source§

fn mul_assign(&mut self, rhs: &Mat4)

Performs the *= operation. Read more
Source§

impl MulAssign<&f32> for Mat4

Source§

fn mul_assign(&mut self, rhs: &f32)

Performs the *= operation. Read more
Source§

impl MulAssign<Affine3> for Mat4

Source§

fn mul_assign(&mut self, rhs: Affine3)

Performs the *= operation. Read more
Source§

impl MulAssign<Affine3A> for Mat4

Source§

fn mul_assign(&mut self, rhs: Affine3A)

Performs the *= operation. Read more
Source§

impl MulAssign<f32> for Mat4

Source§

fn mul_assign(&mut self, rhs: f32)

Performs the *= operation. Read more
Source§

impl MulAssign for Mat4

Source§

fn mul_assign(&mut self, rhs: Mat4)

Performs the *= operation. Read more
Source§

impl Neg for &Mat4

Source§

type Output = Mat4

The resulting type after applying the - operator.
Source§

fn neg(self) -> Mat4

Performs the unary - operation. Read more
Source§

impl Neg for Mat4

Source§

type Output = Mat4

The resulting type after applying the - operator.
Source§

fn neg(self) -> <Mat4 as Neg>::Output

Performs the unary - operation. Read more
Source§

impl PartialEq for Mat4

Source§

fn eq(&self, rhs: &Mat4) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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> Product<&'a Mat4> for Mat4

Source§

fn product<I>(iter: I) -> Mat4
where I: Iterator<Item = &'a Mat4>,

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl Product for Mat4

Source§

fn product<I>(iter: I) -> Mat4
where I: Iterator<Item = Mat4>,

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl<S> Serialize<S> for Mat4
where S: Fallible + ?Sized,

Source§

fn serialize( &self, _: &mut S, ) -> Result<<Mat4 as Archive>::Resolver, <S as Fallible>::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.
Source§

impl Serialize for Mat4

Serialize as a sequence of 16 values.

Source§

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

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

impl Sub<&Mat4> for &Mat4

Source§

type Output = Mat4

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Mat4) -> Mat4

Performs the - operation. Read more
Source§

impl Sub<&Mat4> for Mat4

Source§

type Output = Mat4

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Mat4) -> Mat4

Performs the - operation. Read more
Source§

impl Sub<Mat4> for &Mat4

Source§

type Output = Mat4

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Mat4) -> Mat4

Performs the - operation. Read more
Source§

impl Sub for Mat4

Source§

type Output = Mat4

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Mat4) -> Mat4

Performs the - operation. Read more
Source§

impl SubAssign<&Mat4> for Mat4

Source§

fn sub_assign(&mut self, rhs: &Mat4)

Performs the -= operation. Read more
Source§

impl SubAssign for Mat4

Source§

fn sub_assign(&mut self, rhs: Mat4)

Performs the -= operation. Read more
Source§

impl<'a> Sum<&'a Mat4> for Mat4

Source§

fn sum<I>(iter: I) -> Mat4
where I: Iterator<Item = &'a Mat4>,

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl Sum for Mat4

Source§

fn sum<I>(iter: I) -> Mat4
where I: Iterator<Item = Mat4>,

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl Zeroable for Mat4

Source§

fn zeroed() -> Self

Source§

impl Copy for Mat4

Source§

impl NoUndef for Mat4

Source§

impl Pod for Mat4

Source§

impl Portable for Mat4

Auto Trait Implementations§

§

impl Freeze for Mat4

§

impl RefUnwindSafe for Mat4

§

impl Send for Mat4

§

impl Sync for Mat4

§

impl Unpin for Mat4

§

impl UnsafeUnpin for Mat4

§

impl UnwindSafe for Mat4

Blanket Implementations§

Source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, D: AdaptFrom<S, Swp, Dwp, T>,

Source§

fn adapt_into_using<M>(self, method: M) -> D
where M: TransformMatrix<T>,

Convert the source color to the destination color using the specified method.
Source§

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default.
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> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> ArchiveUnsized for T
where T: Archive,

Source§

type Archived = <T as Archive>::Archived

The archived counterpart of this type. Unlike Archive, it may be unsized. Read more
Source§

fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata

Creates the archived version of the metadata for this value.
Source§

impl<T, C> ArraysFrom<C> for T
where C: IntoArrays<T>,

Source§

fn arrays_from(colors: C) -> T

Cast a collection of colors into a collection of arrays.
Source§

impl<T, C> ArraysInto<C> for T
where C: FromArrays<T>,

Source§

fn arrays_into(self) -> C

Cast this collection of arrays into a collection of colors.
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<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for U
where T: FromCam16Unclamped<WpParam, U>,

Source§

type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar

The number type that’s used in parameters when converting.
Source§

fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
Source§

impl<T> CheckedBitPattern for T
where T: AnyBitPattern,

Source§

type Bits = T

Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
Source§

fn is_valid_bit_pattern(_bits: &T) -> bool

If this function returns true, then it must be valid to reinterpret bits as &Self.
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, C> ComponentsFrom<C> for T
where C: IntoComponents<T>,

Source§

fn components_from(colors: C) -> T

Cast a collection of colors into a collection of color components.
Source§

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

Source§

type Owned = T

A type that holds a sized version of the content.
Source§

unsafe fn read<F, E>(size: usize, f: F) -> Result<T, E>
where F: FnOnce(&mut T) -> Result<(), E>,

Prepares an output buffer, then turns this buffer into an Owned. User-provided closure F must only write to and not read from &mut Self.
Source§

fn get_elements_size() -> usize

Returns the size of each element.
Source§

fn to_void_ptr(&self) -> *const ()

Produces a pointer to the data.
Source§

fn ref_from_ptr<'a>(ptr: *mut (), size: usize) -> Option<*mut T>

Builds a pointer to this type from a raw pointer.
Source§

fn is_size_suitable(size: usize) -> bool

Returns true if the size is suitable to store a type like this.
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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> FromAngle<T> for T

Source§

fn from_angle(angle: T) -> T

Performs a conversion from angle.
Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T, U> FromStimulus<U> for T
where U: IntoStimulus<T>,

Source§

fn from_stimulus(other: U) -> T

Converts other into Self, while performing the appropriate scaling, rounding and clamping.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, U> IntoAngle<U> for T
where U: FromAngle<T>,

Source§

fn into_angle(self) -> U

Performs a conversion into T.
Source§

impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for U
where T: Cam16FromUnclamped<WpParam, U>,

Source§

type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar

The number type that’s used in parameters when converting.
Source§

fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
Source§

impl<T, U> IntoColor<U> for T
where U: FromColor<T>,

Source§

fn into_color(self) -> U

Convert into T with values clamped to the color defined bounds Read more
Source§

impl<T, U> IntoColorUnclamped<U> for T
where U: FromColorUnclamped<T>,

Source§

fn into_color_unclamped(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> IntoStimulus<T> for T

Source§

fn into_stimulus(self) -> T

Converts self into T, while performing the appropriate scaling, rounding and clamping.
Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T> Lerpable for T
where T: Sub<Output = T> + Add<Output = T> + Mul<f32, Output = T> + Copy,

Source§

fn lerp(self, other: Self, progress: f32) -> Self

Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<D> OwoColorize for D

Source§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
Source§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
Source§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
Source§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
Source§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
Source§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
Source§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
Source§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
Source§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
Source§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
Source§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
Source§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
Source§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
Source§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
Source§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
Source§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
Source§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
Source§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
Source§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
Source§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
Source§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
Source§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
Source§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
Source§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
Source§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
Source§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
Source§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
Source§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
Source§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
Source§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
Source§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
Source§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
Source§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
Source§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
Source§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
Source§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
Source§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
Source§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
Source§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
Source§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
Source§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
Source§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
Source§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
Source§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
Source§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
Source§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
Source§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
Source§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
Source§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
Source§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
Source§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
Source§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
Source§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
Source§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, S> SerializeUnsized<S> for T
where T: Serialize<S>, S: Fallible + Writer + ?Sized,

Source§

fn serialize_unsized( &self, serializer: &mut S, ) -> Result<usize, <S as Fallible>::Error>

Writes the object and returns the position of the archived type.
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T> ToSmolStr for T
where T: Display + ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, C> TryComponentsInto<C> for T
where C: TryFromComponents<T>,

Source§

type Error = <C as TryFromComponents<T>>::Error

The error for when try_into_colors fails to cast.
Source§

fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>

Try to cast this collection of color components into a collection of colors. 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.
Source§

impl<T, U> TryIntoColor<U> for T
where U: TryFromColor<T>,

Source§

fn try_into_color(self) -> Result<U, OutOfBounds<U>>

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more
Source§

impl<C, U> UintsFrom<C> for U
where C: IntoUints<U>,

Source§

fn uints_from(colors: C) -> U

Cast a collection of colors into a collection of unsigned integers.
Source§

impl<C, U> UintsInto<C> for U
where C: FromUints<U>,

Source§

fn uints_into(self) -> C

Cast this collection of unsigned integers into a collection of colors.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> AnyBitPattern for T
where T: Pod,

Source§

impl<T, Right> ClosedAdd<Right> for T
where T: Add<Right, Output = T> + AddAssign<Right>,

Source§

impl<T, Right> ClosedAddAssign<Right> for T
where T: ClosedAdd<Right> + AddAssign<Right>,

Source§

impl<T, Right> ClosedDiv<Right> for T
where T: Div<Right, Output = T> + DivAssign<Right>,

Source§

impl<T, Right> ClosedDivAssign<Right> for T
where T: ClosedDiv<Right> + DivAssign<Right>,

Source§

impl<T, Right> ClosedMul<Right> for T
where T: Mul<Right, Output = T> + MulAssign<Right>,

Source§

impl<T, Right> ClosedMulAssign<Right> for T
where T: ClosedMul<Right> + MulAssign<Right>,

Source§

impl<T> ClosedNeg for T
where T: Neg<Output = T>,

Source§

impl<T, Right> ClosedSub<Right> for T
where T: Sub<Right, Output = T> + SubAssign<Right>,

Source§

impl<T, Right> ClosedSubAssign<Right> for T
where T: ClosedSub<Right> + SubAssign<Right>,

Source§

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

Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> NoUninit for T
where T: Pod,

Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,