#[repr(C)]pub struct Boolean(/* private fields */);Expand description
Boolean Type
This boolean type works very similar to the rust primitive type of bool. However, the rust
primitive type has no stable ABI, hence we provide this type to represent booleans on the FFI
interface.
UEFI defines booleans to be 1-byte integers, which can only have the values of 0 or 1.
However, in practice anything non-zero is considered true by nearly all UEFI systems. Hence,
this type implements a boolean over u8 and maps 0 to false, everything else to true.
The binary representation of this type is ABI. That is, you are allowed to transmute from and
to u8. Furthermore, this type never modifies its binary representation. If it was
initialized as, or transmuted from, a specific integer value, this value will be retained.
However, on the rust side you will never see the integer value. It instead behaves truly as a
boolean. If you need access to the integer value, you have to transmute it back to u8.
Implementations§
Trait Implementations§
source§impl Ord for Boolean
impl Ord for Boolean
source§impl PartialOrd<bool> for Boolean
impl PartialOrd<bool> for Boolean
source§impl PartialOrd for Boolean
impl PartialOrd for Boolean
impl Copy for Boolean
impl Eq for Boolean
Auto Trait Implementations§
impl Freeze for Boolean
impl RefUnwindSafe for Boolean
impl Send for Boolean
impl Sync for Boolean
impl Unpin for Boolean
impl UnwindSafe for Boolean
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)