pub trait Dim:
Sized
+ Copy
+ Debug
+ PartialEq
+ 'static {
type Idx: Copy + Debug;
type ChildIdx: Copy + Debug + From<usize> + Into<usize>;
type PrevDim: Dim;
type CardIdx: CardIdx<Self> + Debug;
type LeqIdx: LeqIdx<Self>;
// Required methods
fn dimension() -> usize;
fn left_join_from_lower_dim(
left_most_idx: usize,
lower_idx: <Self::PrevDim as Dim>::Idx,
) -> Self::Idx;
fn left_join_from_lower_card_idx(
left_most_idx: usize,
lower_idx: <Self::PrevDim as Dim>::CardIdx,
) -> Self::CardIdx;
fn in_bounds<T>(
idx: impl IntoIdx<Self>,
vec: &impl NVecCore<Self, T>,
) -> bool;
}
Expand description
Dimensionality of a structure, such as D1 for one-dimensional or D2 for two-dimensional structures.
Required Associated Types§
Sourcetype ChildIdx: Copy + Debug + From<usize> + Into<usize>
type ChildIdx: Copy + Debug + From<usize> + Into<usize>
Index to reach a child of a structure with this dimension, while the child belongs to the previous dimension.
Sourcetype CardIdx: CardIdx<Self> + Debug
type CardIdx: CardIdx<Self> + Debug
Union of indices that can be used to query cardinality of the vector’s any lower dimension children.
Note that these indices belong to lesser dimensions.
For instance, the cardinality index sum of NVec<D2, T>
is
IdxLeqD1
which is an index of dimension D0
or D1
:
- the only
D0
index[]
returns the number of children of the vector; - the
D1
index[i]
returns the number of elements in the i-th child of the vector.
Required Methods§
Sourcefn left_join_from_lower_dim(
left_most_idx: usize,
lower_idx: <Self::PrevDim as Dim>::Idx,
) -> Self::Idx
fn left_join_from_lower_dim( left_most_idx: usize, lower_idx: <Self::PrevDim as Dim>::Idx, ) -> Self::Idx
Left joins the left_most_idx
to lover_idx
of dimension say N
to
get the index of dimension N+1
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.