pub struct Bool<const VAL: bool>;
Expand description
Marker type for passing const VAL: bool
as a type parameter.
Implementations§
Source§impl<const VAL: bool> Bool<VAL>
impl<const VAL: bool> Bool<VAL>
Sourcepub const fn eq<const OTHER: bool>(
self,
_other: Bool<OTHER>,
) -> Result<TypeEq<Bool<VAL>, Bool<OTHER>>, TypeNe<Bool<VAL>, Bool<OTHER>>>
👎Deprecated since 1.8.0: superceeded by equals
method
pub const fn eq<const OTHER: bool>( self, _other: Bool<OTHER>, ) -> Result<TypeEq<Bool<VAL>, Bool<OTHER>>, TypeNe<Bool<VAL>, Bool<OTHER>>>
equals
methodCompares self
and other
for equality.
Returns:
Ok(TypeEq)
: ifVAL == OTHER
Err(TypeNe)
: ifVAL != OTHER
Sourcepub const fn equals<const OTHER: bool>(
self,
_other: Bool<OTHER>,
) -> TypeCmp<Bool<VAL>, Bool<OTHER>>
pub const fn equals<const OTHER: bool>( self, _other: Bool<OTHER>, ) -> TypeCmp<Bool<VAL>, Bool<OTHER>>
Compares self
and other
for equality.
Returns:
TypeCmp::Eq(TypeEq)
: ifVAL == OTHER
TypeCmp::Ne(TypeNe)
: ifVAL != OTHER
For getting a type witness that
Bool<B>
is either Bool<true>
or Bool<false>
,
you can use BoolWit
.
Trait Implementations§
impl<const VAL: bool> Copy for Bool<VAL>
Auto Trait Implementations§
impl<const VAL: bool> Freeze for Bool<VAL>
impl<const VAL: bool> RefUnwindSafe for Bool<VAL>
impl<const VAL: bool> Send for Bool<VAL>
impl<const VAL: bool> Sync for Bool<VAL>
impl<const VAL: bool> Unpin for Bool<VAL>
impl<const VAL: bool> UnwindSafe for Bool<VAL>
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