Skip to main content

ExpectInternal

Trait ExpectInternal 

Source
pub trait ExpectInternal<T> {
    // Required method
    fn expect_internal(self, msg: &str) -> Result<T, HintedString>;
}
Expand description

Adds a method analogous to Option::expect that raises an internal compiler error instead of panicking.

Required Methods§

Source

fn expect_internal(self, msg: &str) -> Result<T, HintedString>

Extracts the value, producing an internal error if self is None.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> ExpectInternal<T> for Option<T>

Implementors§