pub struct OptionData {
pub is_some: bool,
pub payload: KindedSlot,
}Expand description
Optionis_some discriminates Some vs None; payload
carries the inner value for Some. For None the payload is a
KindedSlot::none() placeholder (Bool-kind, zero bits) so
KindedSlot::Drop is a no-op.
Fields§
§is_some: bool§payload: KindedSlotImplementations§
Source§impl OptionData
impl OptionData
Sourcepub fn some(payload: KindedSlot) -> Self
pub fn some(payload: KindedSlot) -> Self
Construct a Some-tagged option.
Trait Implementations§
Source§impl Clone for OptionData
impl Clone for OptionData
Source§fn clone(&self) -> Self
fn clone(&self) -> Self
Per-field clone — KindedSlot::Clone bumps the payload’s
strong-count share. For None the payload is a zero-bits Bool
slot; clone is a no-op refcount-wise.
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OptionData
impl RefUnwindSafe for OptionData
impl Send for OptionData
impl Sync for OptionData
impl Unpin for OptionData
impl UnsafeUnpin for OptionData
impl UnwindSafe for OptionData
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