[][src]Trait proc_macro_error::ResultExt

pub trait ResultExt {
    type Ok;
    fn unwrap_or_exit(self) -> Self::Ok;
fn expect_or_exit(self, msg: &str) -> Self::Ok; }

This traits expands Result<T, Into<MacroError>> with some handy shortcuts.

Associated Types

type Ok

Loading content...

Required methods

fn unwrap_or_exit(self) -> Self::Ok

Behaves like Result::unwrap: if self is Ok yield the contained value, otherwise abort macro execution via span_error!.

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

Behaves like Result::expect: if self is Ok yield the contained value, otherwise abort macro execution via span_error!. If it aborts then resulting message will be preceded with message.

Loading content...

Implementations on Foreign Types

impl<T> ResultExt for Result<T, MultiMacroErrors>[src]

type Ok = T

impl<T, E: Into<MacroError>> ResultExt for Result<T, E>[src]

type Ok = T

Loading content...

Implementors

Loading content...