pub struct Bool32(/* private fields */);Expand description
A 32-bit bool-ish type.
This is repr(transparent) and wraps a u32. When the value is 0 it’s
“false” and when the value is non-zero it’s “true”. The methods of this type
only ever allow the wrapped value to be 0 or 1, but if you make this type
interact with foreign functions they could produce other non-zero values. It
is not an absolute invariant of this type that the wrapped value always be
exactly 0 or 1, the wrapped value can be any value.
For readability, the type formats with Debug and
Display just like a bool, showing as either true
or false.
Implementations§
Trait Implementations§
Source§impl Ord for Bool32
impl Ord for Bool32
Source§impl PartialOrd for Bool32
impl PartialOrd for Bool32
impl Copy for Bool32
impl Eq for Bool32
impl StructuralPartialEq for Bool32
Auto Trait Implementations§
impl Freeze for Bool32
impl RefUnwindSafe for Bool32
impl Send for Bool32
impl Sync for Bool32
impl Unpin for Bool32
impl UnwindSafe for Bool32
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