pub trait Expected<T>where
Self: Sized,{
// Required methods
fn or_exit<F>(self, msgf: F) -> T
where F: FnOnce() -> String;
fn or_die<F>(self, msgf: F) -> T
where F: FnOnce() -> String;
// Provided methods
fn or_exit_(self, msg: &str) -> T { ... }
fn or_die_(self, msg: &str) -> T { ... }
fn expect_or_exit_(self, msg: &str) -> T { ... }
fn expect_or_exit<F>(self, msgf: F) -> T
where F: FnOnce() -> String { ... }
fn expect_or_die_(self, msg: &str) -> T { ... }
fn expect_or_die<F>(self, msgf: F) -> T
where F: FnOnce() -> String { ... }
}This module is in maintenance mode; the anyhow library might be a better choice
Expand description
Unwrap or exit with the specified message.
Required Methodsยง
Sourcefn or_exit<F>(self, msgf: F) -> T
๐Deprecated: This module is in maintenance mode; the anyhow library might be a better choice
fn or_exit<F>(self, msgf: F) -> T
This module is in maintenance mode; the anyhow library might be a better choice
Test the value. On success, return the unwrapped value. On error, unwind the stack, call the supplied function to obtain an error message, display it, and exit.
Sourcefn or_die<F>(self, msgf: F) -> T
๐Deprecated: This module is in maintenance mode; the anyhow library might be a better choice
fn or_die<F>(self, msgf: F) -> T
This module is in maintenance mode; the anyhow library might be a better choice
Test the value. On success, return the unwrapped value. On error, do not unwind the stack, call the supplied function to obtain an error message, display it, and exit.
Provided Methodsยง
Sourcefn or_exit_(self, msg: &str) -> T
๐Deprecated: This module is in maintenance mode; the anyhow library might be a better choice
fn or_exit_(self, msg: &str) -> T
This module is in maintenance mode; the anyhow library might be a better choice
Test the value. On success, return the unwrapped value. On error, unwind the stack, display the specified message, and exit.
Sourcefn or_die_(self, msg: &str) -> T
๐Deprecated: This module is in maintenance mode; the anyhow library might be a better choice
fn or_die_(self, msg: &str) -> T
This module is in maintenance mode; the anyhow library might be a better choice
Test the value. On success, return the unwrapped value. On error, do not unwind the stack, display the specified message, and exit.
Sourcefn expect_or_exit_(self, msg: &str) -> T
๐Deprecated: This module is in maintenance mode; the anyhow library might be a better choice
fn expect_or_exit_(self, msg: &str) -> T
This module is in maintenance mode; the anyhow library might be a better choice
Alias for Expected::or_exit_.
Sourcefn expect_or_exit<F>(self, msgf: F) -> T
๐Deprecated: This module is in maintenance mode; the anyhow library might be a better choice
fn expect_or_exit<F>(self, msgf: F) -> T
This module is in maintenance mode; the anyhow library might be a better choice
Alias for Expected::or_exit.
Sourcefn expect_or_die_(self, msg: &str) -> T
๐Deprecated: This module is in maintenance mode; the anyhow library might be a better choice
fn expect_or_die_(self, msg: &str) -> T
This module is in maintenance mode; the anyhow library might be a better choice
Alias for Expected::or_die_.
Sourcefn expect_or_die<F>(self, msgf: F) -> T
๐Deprecated: This module is in maintenance mode; the anyhow library might be a better choice
fn expect_or_die<F>(self, msgf: F) -> T
This module is in maintenance mode; the anyhow library might be a better choice
Alias for Expected::or_die.
Dyn Compatibilityยง
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".