Trait postfix_assert::PostfixAssertOption[][src]

pub trait PostfixAssertOption: Sealed {
    fn assert_some(self) -> Self;
fn assert_none(self) -> Self; }

Describes the assert_* methods for std::option::Option<T>

This trait is sealed to allow for additional assertion methods in the future. As such, this trait cannot be implemented by the user.

Required methods

fn assert_some(self) -> Self[src]

This checks the Option given and panics if it is not a Some(T). Otherwise it just returns the option back to you.

fn assert_none(self) -> Self[src]

This checks the Option given and panics if it is not None. Otherwise it just returns the option back to you.

Loading content...

Implementations on Foreign Types

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

impl<T> PostfixAssertOption for &Option<T>[src]

Loading content...

Implementors

Loading content...