Struct optional::Optioned
[−]
[src]
pub struct Optioned<T: Noned + Sized + Copy> { // some fields omitted }
An Option
Methods
impl<T: Noned + Sized + Copy> Optioned<T>[src]
fn some(t: T) -> Self
Create an Optioned
# Panics
panics if the supplied value is the None value
# Examples
Optioned::<i32>::some(1); // Optioned(1)
Optioned::<f64>::some(std::f64::NAN); // panic!s
fn none() -> Self
fn is_none(&self) -> bool
fn is_some(&self) -> bool
fn expect(&self, msg: &str) -> T
fn unwrap(&self) -> T
fn unwrap_or(&self, def: T) -> T
fn unwrap_or_else<F>(self, f: F) -> T where F: FnOnce() -> T
fn map<U, F>(self, f: F) -> Option<U> where F: FnOnce(T) -> U
fn map_t<U, F>(self, f: F) -> Self where F: FnOnce(T) -> T
fn map_or<U, F>(self, default: U, f: F) -> U where F: FnOnce(T) -> U
fn map_or_else<U, D, F>(self, default: D, f: F) -> U where D: FnOnce() -> U, F: FnOnce(T) -> U
fn take(&mut self) -> Option<T>
fn iter(&self) -> OptionedIter<T>
Trait Implementations
impl<T: Clone + Noned + Sized + Copy> Clone for Optioned<T>[src]
fn clone(&self) -> Optioned<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more
impl<T: Copy + Noned + Sized + Copy> Copy for Optioned<T>[src]
impl<T> PartialEq for Optioned<T> where T: PartialEq + Noned + Sized + Copy[src]
fn eq(&self, other: &Self) -> bool
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0
This method tests for !=.