Skip to main content

CubeProjectionWitness

Struct CubeProjectionWitness 

Source
pub struct CubeProjectionWitness<const FROM_DIMS: usize, const TO_DIMS: usize> { /* private fields */ }
Expand description

Witness that a projection was performed along a named set of cube dimensions.

§What this is

A zero-cost shape recording that a projection reduced FROM_DIMS original cube dimensions down to TO_DIMS projected dimensions. This is the receipt shape for a projection step — it names that a projection happened and what the arity reduction was.

§What this is not

Not the projection computation. The engine produces this shape; this crate only defines the shape and validates its structural invariants.

§Graduate to wasm4pm

The actual projection computation (sub-log extraction and merging along the dropped dimensions) graduates to wasm4pm.

§Examples

use wasm4pm_compat::process_cube::CubeProjectionWitness;
let _w: CubeProjectionWitness<3, 2> = CubeProjectionWitness::new();

Implementations§

Source§

impl<const FROM_DIMS: usize, const TO_DIMS: usize> CubeProjectionWitness<FROM_DIMS, TO_DIMS>

Source

pub fn new() -> Self

Construct a new CubeProjectionWitness shape marker.

§Examples
use wasm4pm_compat::process_cube::CubeProjectionWitness;
let w: CubeProjectionWitness<4, 2> = CubeProjectionWitness::new();
assert_eq!(w.from_dims(), 4);
assert_eq!(w.to_dims(), 2);
Source

pub const fn from_dims(&self) -> usize

The number of dimensions before the projection.

Source

pub const fn to_dims(&self) -> usize

The number of dimensions after the projection.

Trait Implementations§

Source§

impl<const FROM_DIMS: usize, const TO_DIMS: usize> Default for CubeProjectionWitness<FROM_DIMS, TO_DIMS>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<const FROM_DIMS: usize, const TO_DIMS: usize> Freeze for CubeProjectionWitness<FROM_DIMS, TO_DIMS>

§

impl<const FROM_DIMS: usize, const TO_DIMS: usize> RefUnwindSafe for CubeProjectionWitness<FROM_DIMS, TO_DIMS>

§

impl<const FROM_DIMS: usize, const TO_DIMS: usize> Send for CubeProjectionWitness<FROM_DIMS, TO_DIMS>

§

impl<const FROM_DIMS: usize, const TO_DIMS: usize> Sync for CubeProjectionWitness<FROM_DIMS, TO_DIMS>

§

impl<const FROM_DIMS: usize, const TO_DIMS: usize> Unpin for CubeProjectionWitness<FROM_DIMS, TO_DIMS>

§

impl<const FROM_DIMS: usize, const TO_DIMS: usize> UnsafeUnpin for CubeProjectionWitness<FROM_DIMS, TO_DIMS>

§

impl<const FROM_DIMS: usize, const TO_DIMS: usize> UnwindSafe for CubeProjectionWitness<FROM_DIMS, TO_DIMS>

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

Source§

default fn kind_label(&self) -> &'static str

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