[][src]Trait proc_macro_error::OptionExt

pub trait OptionExt {
    type Some;
    fn expect_or_exit(self, msg: &str) -> Self::Some;
}

This traits expands Option<T> with some handy shortcuts.

Associated Types

type Some

Loading content...

Required methods

fn expect_or_exit(self, msg: &str) -> Self::Some

Behaves like Option::expect: if self is Some yield the contained value, otherwise abort macro execution via call_site_error!. If it aborts the message will be used for compile_error! invocation.

Loading content...

Implementations on Foreign Types

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

type Some = T

Loading content...

Implementors

Loading content...