pub struct Exact<T, const VALUE: i32>(pub T);Expand description
An exact value wrapper using const generics.
This wrapper validates that literal values are exactly equal to the specified VALUE at parse time.
Tuple Fields§
§0: TImplementations§
Trait Implementations§
Source§impl<T: Ord, const VALUE: i32> Ord for Exact<T, VALUE>
impl<T: Ord, const VALUE: i32> Ord for Exact<T, VALUE>
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<T: PartialOrd, const VALUE: i32> PartialOrd for Exact<T, VALUE>
impl<T: PartialOrd, const VALUE: i32> PartialOrd for Exact<T, VALUE>
Source§impl<T: SemanticEq, const VALUE: i32> SemanticEq for Exact<T, VALUE>
impl<T: SemanticEq, const VALUE: i32> SemanticEq for Exact<T, VALUE>
Source§fn semantic_eq(&self, other: &Self) -> bool
fn semantic_eq(&self, other: &Self) -> bool
Returns
true if self and other are semantically equal.Source§impl<T: ToCursors, const VALUE: i32> ToCursors for Exact<T, VALUE>
impl<T: ToCursors, const VALUE: i32> ToCursors for Exact<T, VALUE>
fn to_cursors(&self, s: &mut impl CursorSink)
Source§impl<T: ToNumberValue, const VALUE: i32> ToNumberValue for Exact<T, VALUE>
impl<T: ToNumberValue, const VALUE: i32> ToNumberValue for Exact<T, VALUE>
fn to_number_value(&self) -> Option<f32>
fn to_int_value(&self) -> Option<i32>
impl<T: Copy, const VALUE: i32> Copy for Exact<T, VALUE>
impl<T: Eq, const VALUE: i32> Eq for Exact<T, VALUE>
impl<T, const VALUE: i32> StructuralPartialEq for Exact<T, VALUE>
Auto Trait Implementations§
impl<T, const VALUE: i32> Freeze for Exact<T, VALUE>where
T: Freeze,
impl<T, const VALUE: i32> RefUnwindSafe for Exact<T, VALUE>where
T: RefUnwindSafe,
impl<T, const VALUE: i32> Send for Exact<T, VALUE>where
T: Send,
impl<T, const VALUE: i32> Sync for Exact<T, VALUE>where
T: Sync,
impl<T, const VALUE: i32> Unpin for Exact<T, VALUE>where
T: Unpin,
impl<T, const VALUE: i32> UnwindSafe for Exact<T, VALUE>where
T: 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