Struct cranelift_entity::packed_option::PackedOption [−][src]
pub struct PackedOption<T: ReservedValue>(_);
Packed representation of Option<T>
.
Implementations
impl<T: ReservedValue> PackedOption<T>
[src]
impl<T: ReservedValue> PackedOption<T>
[src]pub fn is_none(&self) -> bool
[src]
Returns true
if the packed option is a None
value.
pub fn is_some(&self) -> bool
[src]
Returns true
if the packed option is a Some
value.
pub fn expand(self) -> Option<T>
[src]
Expand the packed option into a normal Option
.
pub fn map<U, F>(self, f: F) -> Option<U> where
F: FnOnce(T) -> U,
[src]
F: FnOnce(T) -> U,
Maps a PackedOption<T>
to Option<U>
by applying a function to a contained value.
pub fn unwrap(self) -> T
[src]
Unwrap a packed Some
value or panic.
pub fn expect(self, msg: &str) -> T
[src]
Unwrap a packed Some
value or panic.
pub fn take(&mut self) -> Option<T>
[src]
Takes the value out of the packed option, leaving a None
in its place.
Trait Implementations
impl<T: Clone + ReservedValue> Clone for PackedOption<T>
[src]
impl<T: Clone + ReservedValue> Clone for PackedOption<T>
[src]fn clone(&self) -> PackedOption<T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T> Debug for PackedOption<T> where
T: ReservedValue + Debug,
[src]
impl<T> Debug for PackedOption<T> where
T: ReservedValue + Debug,
[src]impl<T: ReservedValue> Default for PackedOption<T>
[src]
impl<T: ReservedValue> Default for PackedOption<T>
[src]impl<T: ReservedValue> From<Option<T>> for PackedOption<T>
[src]
impl<T: ReservedValue> From<Option<T>> for PackedOption<T>
[src]impl<T: ReservedValue> From<T> for PackedOption<T>
[src]
impl<T: ReservedValue> From<T> for PackedOption<T>
[src]impl<T: Hash + ReservedValue> Hash for PackedOption<T>
[src]
impl<T: Hash + ReservedValue> Hash for PackedOption<T>
[src]impl<T: ReservedValue> Into<Option<T>> for PackedOption<T>
[src]
impl<T: ReservedValue> Into<Option<T>> for PackedOption<T>
[src]impl<T: Ord + ReservedValue> Ord for PackedOption<T>
[src]
impl<T: Ord + ReservedValue> Ord for PackedOption<T>
[src]impl<T: PartialEq + ReservedValue> PartialEq<PackedOption<T>> for PackedOption<T>
[src]
impl<T: PartialEq + ReservedValue> PartialEq<PackedOption<T>> for PackedOption<T>
[src]fn eq(&self, other: &PackedOption<T>) -> bool
[src]
fn ne(&self, other: &PackedOption<T>) -> bool
[src]
impl<T: PartialOrd + ReservedValue> PartialOrd<PackedOption<T>> for PackedOption<T>
[src]
impl<T: PartialOrd + ReservedValue> PartialOrd<PackedOption<T>> for PackedOption<T>
[src]fn partial_cmp(&self, other: &PackedOption<T>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn lt(&self, other: &Rhs) -> bool#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn le(&self, other: &Rhs) -> bool#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn gt(&self, other: &Rhs) -> bool#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn ge(&self, other: &Rhs) -> boolimpl<T: Copy + ReservedValue> Copy for PackedOption<T>
[src]
impl<T: Eq + ReservedValue> Eq for PackedOption<T>
[src]
impl<T: ReservedValue> StructuralEq for PackedOption<T>
[src]
impl<T: ReservedValue> StructuralPartialEq for PackedOption<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for PackedOption<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for PackedOption<T> where
T: Send,
T: Send,
impl<T> Sync for PackedOption<T> where
T: Sync,
T: Sync,
impl<T> Unpin for PackedOption<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for PackedOption<T> where
T: UnwindSafe,
T: UnwindSafe,