[][src]Trait skellige::prelude::OptionExt

pub trait OptionExt<T> {
    pub fn has<U>(&self, value: &U) -> bool
    where
        U: PartialEq<T>
; }

Required methods

pub fn has<U>(&self, value: &U) -> bool where
    U: PartialEq<T>, 
[src]

Loading content...

Implementations on Foreign Types

impl<T> OptionExt<T> for Option<T>[src]

pub fn has<U>(&self, x: &U) -> bool where
    U: PartialEq<T>, 
[src]

Returns true if the option is a Some value containing the given value.

Examples

use fungus::core::*;

let x: Option<u32> = Some(2);
assert!(x.has(&2));

let x: Option<u32> = Some(3);
assert!(!x.has(&2));

let x: Option<u32> = None;
assert!(!x.has(&2));
Loading content...

Implementors

Loading content...