pub enum BoolWitG<B> {
True(TypeEq<B, Bool<true>>),
False(TypeEq<B, Bool<false>>),
}Expand description
Type witness that B is either Bool<true> or Bool<false>
Use this over BoolWit if you want to write a HasTypeWitness bound
and adding a const B: bool parameter would be impossible.
§Example
This basic example demonstrates where BoolWitG would be used instead of BoolWit.
use typewit::const_marker::{Bool, BoolWitG};
use typewit::HasTypeWitness;
trait Boolean: Sized + HasTypeWitness<BoolWitG<Self>> {
type Not: Boolean<Not = Self>;
}
impl Boolean for Bool<true> {
type Not = Bool<false>;
}
impl Boolean for Bool<false> {
type Not = Bool<true>;
}Variants§
True(TypeEq<B, Bool<true>>)
Witnesses that B == true
False(TypeEq<B, Bool<false>>)
Witnesses that B == false
Trait Implementations§
Source§impl<B> TypeWitnessTypeArg for BoolWitG<B>
impl<B> TypeWitnessTypeArg for BoolWitG<B>
impl<const B: bool> Copy for BoolWitG<Bool<B>>
Auto Trait Implementations§
impl<B> Freeze for BoolWitG<B>
impl<B> RefUnwindSafe for BoolWitG<B>
impl<B> Send for BoolWitG<B>
impl<B> Sync for BoolWitG<B>
impl<B> Unpin for BoolWitG<B>
impl<B> UnwindSafe for BoolWitG<B>
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