pub struct EmptyCard<D: Dim> { /* private fields */ }
Expand description
Empty cardinality.
Practically this means that the cardinality of the child dimension, and hence, the cardinality of all lower dimension children, of the vector is equal to 0.
Whenever the vector has zero cardinality, it is not capable of producing any valid
value; i.e., there exists no in_bounds
index.
This cardinality is useful in providing a shorthand to create empty or default vectors of any type.
Trait Implementations§
Source§impl<D: Dim> Card<D> for EmptyCard<D>
impl<D: Dim> Card<D> for EmptyCard<D>
Source§fn is_rectangular(&self) -> bool
fn is_rectangular(&self) -> bool
Returns true if the cardinality is bounded and rectangular; i.e, Read more
Source§fn cardinality_of(&self, idx: impl Into<<D as Dim>::CardIdx>) -> usize
fn cardinality_of(&self, idx: impl Into<<D as Dim>::CardIdx>) -> usize
Returns the cardinality of the child of the vector at the given
idx
.Source§fn child_card(&self, i: <D as Dim>::ChildIdx) -> impl Card<<D as Dim>::PrevDim>
fn child_card(&self, i: <D as Dim>::ChildIdx) -> impl Card<<D as Dim>::PrevDim>
Returns the cardinality of the child of this vector at the given
left_most_idx
.Source§fn child_fun<T, F>(
&self,
i: <D as Dim>::ChildIdx,
_fun: F,
) -> impl Fn(<<D as Dim>::PrevDim as Dim>::Idx) -> T
fn child_fun<T, F>( &self, i: <D as Dim>::ChildIdx, _fun: F, ) -> impl Fn(<<D as Dim>::PrevDim as Dim>::Idx) -> T
Creates a function, say
new_fun
, which applies the first of the indices to
left_most_index
such that: Read moreimpl<D: Copy + Dim> Copy for EmptyCard<D>
Auto Trait Implementations§
impl<D> Freeze for EmptyCard<D>
impl<D> RefUnwindSafe for EmptyCard<D>where
D: RefUnwindSafe,
impl<D> Send for EmptyCard<D>where
D: Send,
impl<D> Sync for EmptyCard<D>where
D: Sync,
impl<D> Unpin for EmptyCard<D>where
D: Unpin,
impl<D> UnwindSafe for EmptyCard<D>where
D: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more