Trait IntoOption

Source
pub trait IntoOption<T> {
    // Required method
    fn into_option(self) -> Option<T>;
}
Expand description

Trait representing types that can be converted into a standard Option.

§Examples

use orx_concurrent_option::*;

let con_option: ConcurrentOption<i32> = ConcurrentOption::some(42);
assert_eq!(con_option.into_option(), Some(42));

let option: Option<i32> = Some(42);
assert_eq!(option.into_option(), Some(42));

Required Methods§

Source

fn into_option(self) -> Option<T>

Converts self into Option.

§Examples
use orx_concurrent_option::*;

let con_option: ConcurrentOption<i32> = ConcurrentOption::some(42);
assert_eq!(con_option.into_option(), Some(42));

let option: Option<i32> = Some(42);
assert_eq!(option.into_option(), Some(42));

Implementations on Foreign Types§

Source§

impl<T> IntoOption<T> for Option<T>

Implementors§