Struct cranelift_codegen::packed_option::PackedOption [−][src]
pub struct PackedOption<T>(_)
where
T: ReservedValue;
Packed representation of Option<T>
.
Implementations
impl<T> PackedOption<T> where
T: ReservedValue,
[src]
impl<T> PackedOption<T> where
T: ReservedValue,
[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 for PackedOption<T> where
T: Clone + ReservedValue,
[src]
impl<T> Clone for PackedOption<T> where
T: Clone + ReservedValue,
[src]pub 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> Default for PackedOption<T> where
T: ReservedValue,
[src]
impl<T> Default for PackedOption<T> where
T: ReservedValue,
[src]pub fn default() -> PackedOption<T>
[src]
Create a default packed option representing None
.
impl<T> From<Option<T>> for PackedOption<T> where
T: ReservedValue,
[src]
impl<T> From<Option<T>> for PackedOption<T> where
T: ReservedValue,
[src]pub fn from(opt: Option<T>) -> PackedOption<T>
[src]
Convert an option into its packed equivalent.
impl<T> From<T> for PackedOption<T> where
T: ReservedValue,
[src]
impl<T> From<T> for PackedOption<T> where
T: ReservedValue,
[src]pub fn from(t: T) -> PackedOption<T>
[src]
Convert t
into a packed Some(x)
.
impl<T> Hash for PackedOption<T> where
T: Hash + ReservedValue,
[src]
impl<T> Hash for PackedOption<T> where
T: Hash + ReservedValue,
[src]impl<T> Into<Option<T>> for PackedOption<T> where
T: ReservedValue,
[src]
impl<T> Into<Option<T>> for PackedOption<T> where
T: ReservedValue,
[src]impl<T> Ord for PackedOption<T> where
T: Ord + ReservedValue,
[src]
impl<T> Ord for PackedOption<T> where
T: Ord + ReservedValue,
[src]impl<T> PartialEq<PackedOption<T>> for PackedOption<T> where
T: PartialEq<T> + ReservedValue,
[src]
impl<T> PartialEq<PackedOption<T>> for PackedOption<T> where
T: PartialEq<T> + ReservedValue,
[src]pub fn eq(&self, other: &PackedOption<T>) -> bool
[src]
pub fn ne(&self, other: &PackedOption<T>) -> bool
[src]
impl<T> PartialOrd<PackedOption<T>> for PackedOption<T> where
T: PartialOrd<T> + ReservedValue,
[src]
impl<T> PartialOrd<PackedOption<T>> for PackedOption<T> where
T: PartialOrd<T> + ReservedValue,
[src]pub 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 for PackedOption<T> where
T: Copy + ReservedValue,
[src]
T: Copy + ReservedValue,
impl<T> Eq for PackedOption<T> where
T: Eq + ReservedValue,
[src]
T: Eq + ReservedValue,
impl<T> StructuralEq for PackedOption<T> where
T: ReservedValue,
[src]
T: ReservedValue,
impl<T> StructuralPartialEq for PackedOption<T> where
T: ReservedValue,
[src]
T: ReservedValue,
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,