pub struct FeatureIndex<const MAX_FEATURES: usize> { /* private fields */ }Expand description
Type-safe feature index with compile-time bounds checking
Implementations§
Source§impl<const MAX_FEATURES: usize> FeatureIndex<MAX_FEATURES>
impl<const MAX_FEATURES: usize> FeatureIndex<MAX_FEATURES>
Sourcepub const fn new(index: usize) -> Option<Self>
pub const fn new(index: usize) -> Option<Self>
Create a new feature index with compile-time bounds checking
Sourcepub const unsafe fn new_unchecked(index: usize) -> Self
pub const unsafe fn new_unchecked(index: usize) -> Self
Create a new feature index without bounds checking (unsafe)
§Safety
The caller must ensure that index < MAX_FEATURES
Sourcepub const fn to_runtime(self) -> RuntimeFeatureIndex
pub const fn to_runtime(self) -> RuntimeFeatureIndex
Convert to a runtime feature index
Trait Implementations§
Source§impl<const MAX_FEATURES: usize> Clone for FeatureIndex<MAX_FEATURES>
impl<const MAX_FEATURES: usize> Clone for FeatureIndex<MAX_FEATURES>
Source§fn clone(&self) -> FeatureIndex<MAX_FEATURES>
fn clone(&self) -> FeatureIndex<MAX_FEATURES>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<const MAX_FEATURES: usize> Debug for FeatureIndex<MAX_FEATURES>
impl<const MAX_FEATURES: usize> Debug for FeatureIndex<MAX_FEATURES>
Source§impl<const MAX_FEATURES: usize> Ord for FeatureIndex<MAX_FEATURES>
impl<const MAX_FEATURES: usize> Ord for FeatureIndex<MAX_FEATURES>
Source§fn cmp(&self, other: &FeatureIndex<MAX_FEATURES>) -> Ordering
fn cmp(&self, other: &FeatureIndex<MAX_FEATURES>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<const MAX_FEATURES: usize> PartialEq for FeatureIndex<MAX_FEATURES>
impl<const MAX_FEATURES: usize> PartialEq for FeatureIndex<MAX_FEATURES>
Source§impl<const MAX_FEATURES: usize> PartialOrd for FeatureIndex<MAX_FEATURES>
impl<const MAX_FEATURES: usize> PartialOrd for FeatureIndex<MAX_FEATURES>
Source§impl<const N: usize> ZeroCostTransform<FeatureIndex<N>, usize> for ()
Zero-cost feature index conversion
impl<const N: usize> ZeroCostTransform<FeatureIndex<N>, usize> for ()
Zero-cost feature index conversion
Source§fn transform_zero_cost(input: FeatureIndex<N>) -> usize
fn transform_zero_cost(input: FeatureIndex<N>) -> usize
Apply the transformation with zero runtime cost
impl<const MAX_FEATURES: usize> Copy for FeatureIndex<MAX_FEATURES>
impl<const MAX_FEATURES: usize> Eq for FeatureIndex<MAX_FEATURES>
impl<const MAX_FEATURES: usize> StructuralPartialEq for FeatureIndex<MAX_FEATURES>
Auto Trait Implementations§
impl<const MAX_FEATURES: usize> Freeze for FeatureIndex<MAX_FEATURES>
impl<const MAX_FEATURES: usize> RefUnwindSafe for FeatureIndex<MAX_FEATURES>
impl<const MAX_FEATURES: usize> Send for FeatureIndex<MAX_FEATURES>
impl<const MAX_FEATURES: usize> Sync for FeatureIndex<MAX_FEATURES>
impl<const MAX_FEATURES: usize> Unpin for FeatureIndex<MAX_FEATURES>
impl<const MAX_FEATURES: usize> UnwindSafe for FeatureIndex<MAX_FEATURES>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.