Skip to main content

ProductTable

Struct ProductTable 

Source
pub struct ProductTable { /* private fields */ }
Expand description

Precomputed product table for a geometric algebra.

Stores the sign and result blade for all pairs of basis blades. This enables O(1) lookup of any product during code generation.

§Example

use clifford_codegen::algebra::{Algebra, ProductTable};

let algebra = Algebra::euclidean(3);
let table = ProductTable::new(&algebra);

// e1 * e2 = e12 with sign +1
let (sign, result) = table.geometric(1, 2);
assert_eq!(sign, 1);
assert_eq!(result, 3);

// e2 * e1 = -e12 (anticommutative)
let (sign, result) = table.geometric(2, 1);
assert_eq!(sign, -1);
assert_eq!(result, 3);

Implementations§

Source§

impl ProductTable

Source

pub fn new(algebra: &Algebra) -> Self

Builds a product table for the given algebra.

Precomputes all products where n = 2^dim.

§Example
use clifford_codegen::algebra::{Algebra, ProductTable};

let algebra = Algebra::euclidean(3);
let table = ProductTable::new(&algebra);

// Table has 8*8 = 64 entries for 3D
assert_eq!(table.dim(), 3);
Source

pub fn dim(&self) -> usize

Returns the algebra dimension.

Source

pub fn num_blades(&self) -> usize

Returns the number of blades (2^dim).

Source

pub fn geometric(&self, a: usize, b: usize) -> (i8, usize)

Looks up the geometric product of two basis blades.

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is the blade index of the product
§Panics

Panics if a or b is out of bounds.

§Example
use clifford_codegen::algebra::{Algebra, ProductTable};

let algebra = Algebra::euclidean(3);
let table = ProductTable::new(&algebra);

// e12 * e12 = -1 (bivector squares to -1)
let (sign, result) = table.geometric(3, 3);
assert_eq!(sign, -1);
assert_eq!(result, 0);
Source

pub fn sign(&self, a: usize, b: usize) -> i8

Returns the sign of the product of two basis blades.

Source

pub fn result(&self, a: usize, b: usize) -> usize

Returns the result blade of the product of two basis blades.

Source

pub fn product_contributions( &self, a_blades: &[usize], b_blades: &[usize], result_blade: usize, ) -> Vec<(i8, usize, usize)>

Returns the metric value for a basis vector. Finds all products that contribute to a given result blade.

Given sets of input blades A and B, returns all (a, b) pairs such that a * b = result (with non-zero sign).

§Arguments
  • a_blades - Set of blade indices from the first operand
  • b_blades - Set of blade indices from the second operand
  • result_blade - The target result blade index
§Returns

Vector of (sign, a_blade, b_blade) tuples contributing to the result.

§Example
use clifford_codegen::algebra::{Algebra, ProductTable};

let algebra = Algebra::euclidean(3);
let table = ProductTable::new(&algebra);

// Which vector * vector products contribute to e12?
let vectors = vec![1, 2, 4]; // e1, e2, e3
let contributions = table.product_contributions(&vectors, &vectors, 3);

// e1 * e2 = +e12, e2 * e1 = -e12
assert_eq!(contributions.len(), 2);
assert!(contributions.contains(&(1, 1, 2)));  // e1 * e2 = +e12
assert!(contributions.contains(&(-1, 2, 1))); // e2 * e1 = -e12
Source

pub fn has_contributions_to_grade( &self, a_blades: &[usize], b_blades: &[usize], target_grade: usize, ) -> bool

Checks if a product contributes to a given grade.

Returns true if any a * b product (for a in a_blades, b in b_blades) produces a blade of the target grade.

Source

pub fn all_products( &self, a_blades: &[usize], b_blades: &[usize], ) -> ProductContributions

Returns all result blades from products of a_blades × b_blades.

§Returns

Vector of (blade_index, contributions) pairs, sorted by blade index. Each contribution is (sign, a_blade, b_blade).

Source

pub fn complement(&self, blade: usize) -> (i8, usize)

Computes the right complement of a blade.

The right complement maps a grade-k blade to a grade-(n-k) blade where n = dim. For blade index i, the complement index is (2^dim - 1) XOR i.

The right complement is defined by: u ∧ ū = I (pseudoscalar) where ∧ is the exterior (wedge) product.

§Returns

A tuple (sign, complement_index) where sign is ±1 based on the permutation required to bring the blade and its complement into canonical order to form the pseudoscalar via the exterior product.

§Example
use clifford_codegen::algebra::{Algebra, ProductTable};

let algebra = Algebra::euclidean(3);
let table = ProductTable::new(&algebra);

// In 3D: complement(e1) = e23 (with some sign)
let (sign, result) = table.complement(1);
assert_eq!(result, 6); // e23 = 0b110
Source

pub fn exterior(&self, a: usize, b: usize) -> (i8, usize)

Computes the exterior (wedge) product of two basis blades.

The exterior product a ∧ b:

  • Is zero if the blades share any basis vectors (a & b != 0)
  • Otherwise equals a | b with a sign from reordering
§Returns

A tuple (sign, result) where:

  • sign is 0 if blades overlap, or ±1 from reordering
  • result is the blade index of the product
§Example
use clifford_codegen::algebra::{Algebra, ProductTable};

let algebra = Algebra::euclidean(3);
let table = ProductTable::new(&algebra);

// e1 ∧ e2 = e12
let (sign, result) = table.exterior(1, 2);
assert_eq!(sign, 1);
assert_eq!(result, 3);

// e1 ∧ e1 = 0 (same basis vector)
let (sign, result) = table.exterior(1, 1);
assert_eq!(sign, 0);
Source

pub fn regressive(&self, a: usize, b: usize) -> (i8, usize)

Computes the regressive (meet) product of two basis blades.

The regressive product is defined as: a ∨ b = ∁(∁a ∧ ∁b) where is the right complement.

This is the dual of the exterior product - while the exterior product computes the “join” (smallest subspace containing both), the regressive product computes the “meet” (intersection).

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is the blade index of the regressive product

Note: The sign may be 0 if the product vanishes.

§Example
use clifford_codegen::algebra::{Algebra, ProductTable};

let algebra = Algebra::pga(2); // 2D PGA: Cl(2,0,1)
let table = ProductTable::new(&algebra);

// In 2D PGA, Line (grade 2) ∨ Line (grade 2) = Point (grade 1)
// Result grade = 2 + 2 - 3 = 1
let e12 = 0b011; // grade 2 blade
let e01 = 0b101; // grade 2 blade
let (sign, result) = table.regressive(e12, e01);
assert_ne!(sign, 0, "regressive product should be non-zero");
Source

pub fn antiproduct(&self, a: usize, b: usize) -> (i8, usize)

Computes the geometric antiproduct of two blades.

The antiproduct is defined as: a ⊛ b = ∁(∁a × ∁b)

where × is the regular geometric product and is the complement.

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is the blade index of the antiproduct

Note: The sign may be 0 if the product vanishes.

Source

pub fn exterior_anti(&self, a: usize, b: usize) -> (i8, usize)

Computes the exterior antiproduct (regressive/antiwedge product) of two blades.

This is an alias for regressive() - the dual of the exterior product. The antiwedge a ∨ b combines the “empty dimensions” of its operands.

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is the blade index of the antiwedge product
Source

pub fn left_contraction(&self, a: usize, b: usize) -> (i8, usize)

Computes the left contraction (interior product) of two basis blades.

The left contraction a ⌋ b extracts the grade grade(b) - grade(a) part of the geometric product. It is zero if grade(a) > grade(b).

Geometrically, this “removes” the component of b that is parallel to a.

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is the blade index of the contraction
§Example
use clifford_codegen::algebra::{Algebra, ProductTable};

let algebra = Algebra::euclidean(3);
let table = ProductTable::new(&algebra);

// e1 ⌋ e12 = e2 (grade 2 - 1 = 1)
let (sign, result) = table.left_contraction(1, 3);
assert_eq!(sign, 1);
assert_eq!(result, 2); // e2

// e12 ⌋ e1 = 0 (grade 2 > grade 1)
let (sign, _) = table.left_contraction(3, 1);
assert_eq!(sign, 0);
Source

pub fn right_contraction(&self, a: usize, b: usize) -> (i8, usize)

Computes the right contraction of two basis blades.

The right contraction a ⌊ b extracts the grade grade(a) - grade(b) part of the geometric product. It is zero if grade(b) > grade(a).

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is the blade index of the contraction
§Example
use clifford_codegen::algebra::{Algebra, ProductTable};

let algebra = Algebra::euclidean(3);
let table = ProductTable::new(&algebra);

// e12 ⌊ e2 = e1 (grade 2 - 1 = 1)
let (sign, result) = table.right_contraction(3, 2);
assert_eq!(sign, 1);   // e12 * e2 = e1 e2 e2 = e1 * (+1) = e1
assert_eq!(result, 1); // e1

// e1 ⌊ e12 = 0 (grade 1 < grade 2)
let (sign, _) = table.right_contraction(1, 3);
assert_eq!(sign, 0);
Source

pub fn interior(&self, a: usize, b: usize) -> (i8, usize)

Computes the interior product (symmetric contraction) of two basis blades.

The interior product extracts the grade |grade(a) - grade(b)| part of the geometric product. It’s the symmetric version of the contractions.

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is the blade index of the interior product
§Example
use clifford_codegen::algebra::{Algebra, ProductTable};

let algebra = Algebra::euclidean(3);
let table = ProductTable::new(&algebra);

// e12 · e2 = e1 (grade |2 - 1| = 1)
let (sign, result) = table.interior(3, 2);
assert_eq!(sign, 1);
assert_eq!(result, 1); // e1

// e1 · e2 = 0 (orthogonal, grade |1 - 1| = 0 but no scalar part)
let (sign, _) = table.interior(1, 2);
assert_eq!(sign, 0);
Source

pub fn scalar(&self, a: usize, b: usize) -> (i8, usize)

Computes the scalar product of two basis blades.

The scalar product extracts only the grade-0 (scalar) part of the geometric product. This is equivalent to the dot product for same-grade blades, but returns zero for different grades.

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is always 0 (scalar) when non-zero
§Example
use clifford_codegen::algebra::{Algebra, ProductTable};

let algebra = Algebra::euclidean(3);
let table = ProductTable::new(&algebra);

// e1 * e1 = 1 (scalar)
let (sign, result) = table.scalar(1, 1);
assert_eq!(sign, 1);
assert_eq!(result, 0);

// e1 * e2 has no scalar part
let (sign, _) = table.scalar(1, 2);
assert_eq!(sign, 0);
Source

pub fn antiscalar(&self, a: usize, b: usize) -> (i8, usize)

Computes the antiscalar product of two basis blades.

The antiscalar product extracts only the grade-n (pseudoscalar) part of the antiproduct, where n is the dimension of the algebra.

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is the pseudoscalar blade index when non-zero
§Example
use clifford_codegen::algebra::{Algebra, ProductTable};

let algebra = Algebra::pga(3);
let table = ProductTable::new(&algebra);

// Pseudoscalar index for 4D algebra (PGA 3D has 4 basis vectors)
let pseudoscalar = (1 << 4) - 1; // 0b1111 = 15

// e1234 ∨ e1234 = e1234 (antiscalar part)
// In the antiproduct, pseudoscalar acts like scalar does in geometric product
let (sign, result) = table.antiscalar(pseudoscalar, pseudoscalar);
assert_eq!(sign, 1);
assert_eq!(result, pseudoscalar);

// 1 ∨ e1234 has no antiscalar part (result is scalar, not pseudoscalar)
let (sign, _) = table.antiscalar(0, pseudoscalar);
assert_eq!(sign, 0);
Source

pub fn dot(&self, a: usize, b: usize) -> (i8, usize)

Computes the dot product (scalar product) of two basis blades.

The dot product a • b is non-zero only when the blades have the same grade. It extracts the scalar part of the geometric product for equal-grade blades.

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is always 0 (scalar) when non-zero
§Example
use clifford_codegen::algebra::{Algebra, ProductTable};

let algebra = Algebra::euclidean(3);
let table = ProductTable::new(&algebra);

// e1 • e1 = 1 (same grade, scalar result)
let (sign, result) = table.dot(1, 1);
assert_eq!(sign, 1);
assert_eq!(result, 0); // scalar

// e1 • e2 = 0 (orthogonal vectors)
let (sign, _) = table.dot(1, 2);
assert_eq!(sign, 0);

// e1 • e12 = 0 (different grades)
let (sign, _) = table.dot(1, 3);
assert_eq!(sign, 0);
Source

pub fn antidot(&self, a: usize, b: usize) -> (i8, usize)

Computes the antidot product of two basis blades.

The antidot product a ⊚ b is the De Morgan dual of the dot product: a ⊚ b = ∁a • ∁b (complement dot complement).

Like the dot product, it is non-zero only when blades have the same antigrade (which is equivalent to same grade). Returns a scalar.

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is always 0 (scalar) when non-zero
§Example
use clifford_codegen::algebra::{Algebra, ProductTable};

let algebra = Algebra::euclidean(3);
let table = ProductTable::new(&algebra);

// e1 ⊚ e1 (same grade/antigrade)
let (sign, result) = table.antidot(1, 1);
assert_eq!(result, 0); // scalar
Source

pub fn left_contraction_anti(&self, a: usize, b: usize) -> (i8, usize)

Computes the left anti-contraction of two basis blades.

The left anti-contraction is the dual of the left contraction: a ⌋̄ b = ∁(∁a ⌋ ∁b)

This extracts the antigrade antigrade(b) - antigrade(a) part.

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is the blade index of the anti-contraction
Source

pub fn right_contraction_anti(&self, a: usize, b: usize) -> (i8, usize)

Computes the right anti-contraction of two basis blades.

The right anti-contraction is the dual of the right contraction: a ⌊̄ b = ∁(∁a ⌊ ∁b)

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is the blade index of the anti-contraction
Source

pub fn dot_anti(&self, a: usize, b: usize) -> (i8, usize)

Computes the antidot product of two basis blades.

The antidot product is the dual of the dot product: a ◯ b = ∁(∁a • ∁b)

It is non-zero only when the blades have the same antigrade (dual grade).

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is the blade index (pseudoscalar when non-zero)
§Example
use clifford_codegen::algebra::{Algebra, ProductTable};

let algebra = Algebra::euclidean(3);
let table = ProductTable::new(&algebra);

// e23 ◯ e23 in 3D: complements are e1, e1 • e1 = 1, complement(1) = e123
let (sign, result) = table.dot_anti(6, 6);
assert_ne!(sign, 0);
assert_eq!(result, 7); // pseudoscalar
Source

pub fn bulk_dual(&self, blade: usize) -> (i8, usize)

Computes the bulk dual (metric dual) of a basis blade.

The bulk dual u★ is defined as: u★ = ũ ⋉ 𝟙 where ũ is the reverse and ⋉ is the geometric product with the pseudoscalar.

The bulk dual is the “complement of the bulk components” - it uses the metric to map a blade to its orthogonal complement in the full algebra.

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is the blade index of the bulk dual
§Example
use clifford_codegen::algebra::{Algebra, ProductTable};

let algebra = Algebra::euclidean(3);
let table = ProductTable::new(&algebra);

// e1★ in 3D: reverse(e1) = e1, e1 * e123 = e23
let (sign, result) = table.bulk_dual(1);
assert_eq!(result, 6); // e23
Source

pub fn weight_dual(&self, blade: usize) -> (i8, usize)

Computes the weight dual (metric antidual) of a basis blade.

The weight dual u☆ is defined as: u☆ = ũ ⋇ 1 where ũ is the reverse and ⋇ is the geometric antiproduct with the scalar.

The weight dual is the “complement of the weight components” - it uses the anti-metric to map a blade to its orthogonal complement.

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is the blade index of the weight dual
§Example
use clifford_codegen::algebra::{Algebra, ProductTable};

let algebra = Algebra::euclidean(3);
let table = ProductTable::new(&algebra);

// e1☆ in 3D uses the antiproduct with scalar
let (sign, result) = table.weight_dual(1);
assert_ne!(sign, 0);
Source

pub fn left_bulk_dual(&self, blade: usize) -> (i8, usize)

Computes the left bulk dual of a basis blade.

The left bulk dual is: ★u = 𝟙 ⋉ ũ This is the “left version” where the pseudoscalar is on the left.

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is the blade index of the left bulk dual
Source

pub fn left_weight_dual(&self, blade: usize) -> (i8, usize)

Computes the left weight dual of a basis blade.

The left weight dual is: ☆u = 1 ⋇ ũ This is the “left version” where the scalar is on the left in the antiproduct.

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is the blade index of the left weight dual
Source

pub fn bulk_contraction(&self, a: usize, b: usize) -> (i8, usize)

Computes the bulk contraction of two basis blades.

The bulk contraction is defined as: a ∨ b★ where ∨ is the antiwedge and ★ is the bulk dual.

This is one of the four RGA interior products. It reduces grade.

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is the blade index of the bulk contraction
Source

pub fn weight_contraction(&self, a: usize, b: usize) -> (i8, usize)

Computes the weight contraction of two basis blades.

The weight contraction is defined as: a ∨ b☆ where ∨ is the antiwedge and ☆ is the weight dual.

This is one of the four RGA interior products. It reduces grade.

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is the blade index of the weight contraction
Source

pub fn bulk_expansion(&self, a: usize, b: usize) -> (i8, usize)

Computes the bulk expansion of two basis blades.

The bulk expansion is defined as: a ∧ b★ where ∧ is the wedge and ★ is the bulk dual.

This is one of the four RGA interior products. It reduces antigrade.

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is the blade index of the bulk expansion
Source

pub fn weight_expansion(&self, a: usize, b: usize) -> (i8, usize)

Computes the weight expansion of two basis blades.

The weight expansion is defined as: a ∧ b☆ where ∧ is the wedge and ☆ is the weight dual.

This is one of the four RGA interior products. It reduces antigrade.

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is the blade index of the weight expansion
Source

pub fn project(&self, a: usize, b: usize) -> (i8, usize)

Computes the projection of a onto b.

The projection is defined as: b ∨ (a ∧ b☆) where ∨ is the antiwedge, ∧ is the wedge, and ☆ is the weight dual.

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is the blade index of the projection
Source

pub fn project_triple( &self, a: usize, b_dual: usize, b_antiwedge: usize, ) -> (i8, usize)

Computes the projection contribution for a triple of blades.

For multi-blade types, the projection B ∨ (A ∧ B☆) expands to: Σ_{i,j,k} b_k ∨ (a_i ∧ b_j☆)

This method computes one term: b_antiwedge ∨ (a ∧ b_dual☆)

§Arguments
  • a: The source blade index
  • b_dual: The target blade to take weight dual of
  • b_antiwedge: The target blade for the final antiwedge
§Returns

A tuple (sign, result) for this contribution.

Source

pub fn antiproject_triple( &self, a: usize, b_dual: usize, b_wedge: usize, ) -> (i8, usize)

Computes the antiprojection contribution for a triple of blades.

For multi-blade types, the antiprojection B ∧ (A ∨ B☆) expands to: Σ_{i,j,k} b_k ∧ (a_i ∨ b_j☆)

This method computes one term: b_wedge ∧ (a ∨ b_dual☆)

§Arguments
  • a: The source blade index
  • b_dual: The target blade to take weight dual of
  • b_wedge: The target blade for the final wedge
§Returns

A tuple (sign, result) for this contribution.

Source

pub fn antiproject(&self, a: usize, b: usize) -> (i8, usize)

Computes the antiprojection of a onto b.

The antiprojection is defined as: b ∧ (a ∨ b☆) where ∧ is the wedge, ∨ is the antiwedge, and ☆ is the weight dual.

§Returns

A tuple (sign, result) where:

  • sign is the sign factor (-1, 0, or +1)
  • result is the blade index of the antiprojection

Trait Implementations§

Source§

impl Clone for ProductTable

Source§

fn clone(&self) -> ProductTable

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 Debug for ProductTable

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
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<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
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> 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> 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> 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<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
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> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
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.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
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> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.