pub struct Choice(/* private fields */);Expand description
A branch-free boolean whose value is never observable through control flow.
Stored as 0 or 1 so it can be expanded to a full-width bitmask by
Choice::mask and consumed by the select_* helpers.
Implementations§
Source§impl Choice
impl Choice
Sourcepub fn unwrap_u8(self) -> u8
pub fn unwrap_u8(self) -> u8
Reveal the boolean as 0 or 1.
This is the one place a secret becomes branchable; call it once, at the API boundary.
Trait Implementations§
impl Copy for Choice
impl Eq for Choice
impl StructuralPartialEq for Choice
Auto Trait Implementations§
impl Freeze for Choice
impl RefUnwindSafe for Choice
impl Send for Choice
impl Sync for Choice
impl Unpin for Choice
impl UnsafeUnpin for Choice
impl UnwindSafe for Choice
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