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§
Sourcefn into_option(self) -> Option<T>
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));