Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
OptionExt in proc_macro_error - Rust
[go: Go Back, main page]

Trait proc_macro_error::OptionExt

source ·
pub trait OptionExt {
    type Some;

    // Required method
    fn expect_or_abort(self, msg: &str) -> Self::Some;
}
Expand description

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

Required Associated Types§

Required Methods§

source

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

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

Implementations on Foreign Types§

source§

impl<T> OptionExt for Option<T>

§

type Some = T

source§

fn expect_or_abort(self, message: &str) -> T

Implementors§