pub struct ConstCtOption<T> { /* private fields */ }
Expand description
An equivalent of subtle::CtOption
usable in a const fn
context.
Implementations§
Source§impl<T> ConstCtOption<T>
impl<T> ConstCtOption<T>
Sourcepub const fn is_some(&self) -> ConstChoice
pub const fn is_some(&self) -> ConstChoice
Returns a true ConstChoice
if this value is Some
.
Sourcepub const fn is_none(&self) -> ConstChoice
pub const fn is_none(&self) -> ConstChoice
Returns a true ConstChoice
if this value is None
.
Source§impl<const LIMBS: usize> ConstCtOption<Uint<LIMBS>>
impl<const LIMBS: usize> ConstCtOption<Uint<LIMBS>>
Sourcepub const fn unwrap_or(self, def: Uint<LIMBS>) -> Uint<LIMBS>
pub const fn unwrap_or(self, def: Uint<LIMBS>) -> Uint<LIMBS>
This returns the underlying value if it is Some
or the provided value otherwise.
Source§impl<const LIMBS: usize> ConstCtOption<Int<LIMBS>>
impl<const LIMBS: usize> ConstCtOption<Int<LIMBS>>
Source§impl ConstCtOption<NonZero<Limb>>
impl ConstCtOption<NonZero<Limb>>
Source§impl<const SAT_LIMBS: usize, const UNSAT_LIMBS: usize> ConstCtOption<SafeGcdInverter<SAT_LIMBS, UNSAT_LIMBS>>
impl<const SAT_LIMBS: usize, const UNSAT_LIMBS: usize> ConstCtOption<SafeGcdInverter<SAT_LIMBS, UNSAT_LIMBS>>
Sourcepub const fn expect(self, msg: &str) -> SafeGcdInverter<SAT_LIMBS, UNSAT_LIMBS>
pub const fn expect(self, msg: &str) -> SafeGcdInverter<SAT_LIMBS, UNSAT_LIMBS>
Returns the contained value, consuming the self
value.
§Panics
Panics if the value is none with a custom panic message provided by
msg
.
Trait Implementations§
Source§impl<T: Clone> Clone for ConstCtOption<T>
impl<T: Clone> Clone for ConstCtOption<T>
Source§fn clone(&self) -> ConstCtOption<T>
fn clone(&self) -> ConstCtOption<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for ConstCtOption<T>
impl<T: Debug> Debug for ConstCtOption<T>
Source§impl<T> From<ConstCtOption<T>> for CtOption<T>
impl<T> From<ConstCtOption<T>> for CtOption<T>
Source§fn from(value: ConstCtOption<T>) -> Self
fn from(value: ConstCtOption<T>) -> Self
Converts to this type from the input type.
Source§impl<T> From<ConstCtOption<T>> for Option<T>
impl<T> From<ConstCtOption<T>> for Option<T>
Source§fn from(value: ConstCtOption<T>) -> Self
fn from(value: ConstCtOption<T>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<T> Freeze for ConstCtOption<T>where
T: Freeze,
impl<T> RefUnwindSafe for ConstCtOption<T>where
T: RefUnwindSafe,
impl<T> Send for ConstCtOption<T>where
T: Send,
impl<T> Sync for ConstCtOption<T>where
T: Sync,
impl<T> Unpin for ConstCtOption<T>where
T: Unpin,
impl<T> UnwindSafe for ConstCtOption<T>where
T: UnwindSafe,
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