pub trait ExpectedWithError<T>: Expected<T> {
// Required methods
fn or_exit_e<F>(self, msgf: F) -> T
where F: FnOnce() -> String;
fn or_die_e<F>(self, msgf: F) -> T
where F: FnOnce() -> String;
// Provided methods
fn or_exit_e_(self, msg: &str) -> T { ... }
fn or_die_e_(self, msg: &str) -> T { ... }
fn expect_or_exit_perror_(self, msg: &str) -> T { ... }
fn expect_or_exit_perror<F>(self, msgf: F) -> T
where F: FnOnce() -> String { ... }
fn expect_or_die_perror_(self, msg: &str) -> T { ... }
fn expect_or_die_perror<F>(self, msgf: F) -> T
where F: FnOnce() -> String { ... }
}anyhow library might be a better choiceExpand description
Unwrap or exit with an appropriate error message.
Required Methodsยง
Sourcefn or_exit_e<F>(self, msgf: F) -> T
๐Deprecated: This module is in maintenance mode; the anyhow library might be a better choice
fn or_exit_e<F>(self, msgf: F) -> T
anyhow library might be a better choiceTest the value. On success, return the unwrapped value. On error, unwind the stack, call the supplied function to obtain an error message, display it, append an appropriate description of the error, and exit.
Sourcefn or_die_e<F>(self, msgf: F) -> T
๐Deprecated: This module is in maintenance mode; the anyhow library might be a better choice
fn or_die_e<F>(self, msgf: F) -> T
anyhow library might be a better choiceTest 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, append an appropriate description of the error, and exit.
Provided Methodsยง
Sourcefn or_exit_e_(self, msg: &str) -> T
๐Deprecated: This module is in maintenance mode; the anyhow library might be a better choice
fn or_exit_e_(self, msg: &str) -> T
anyhow library might be a better choiceTest the value. On success, return the unwrapped value. On error, unwind the stack, display the specified message, append an appropriate description of the error, and exit.
Sourcefn or_die_e_(self, msg: &str) -> T
๐Deprecated: This module is in maintenance mode; the anyhow library might be a better choice
fn or_die_e_(self, msg: &str) -> T
anyhow library might be a better choiceTest the value. On success, return the unwrapped value. On error, do not unwind the stack, display the specified message, append an appropriate description of the error, and exit.
Sourcefn expect_or_exit_perror_(self, msg: &str) -> T
๐Deprecated: This module is in maintenance mode; the anyhow library might be a better choice
fn expect_or_exit_perror_(self, msg: &str) -> T
anyhow library might be a better choiceAlias for ExpectedWithError::or_exit_e_.
Sourcefn expect_or_exit_perror<F>(self, msgf: F) -> T
๐Deprecated: This module is in maintenance mode; the anyhow library might be a better choice
fn expect_or_exit_perror<F>(self, msgf: F) -> T
anyhow library might be a better choiceAlias for ExpectedWithError::or_exit_e.
Sourcefn expect_or_die_perror_(self, msg: &str) -> T
๐Deprecated: This module is in maintenance mode; the anyhow library might be a better choice
fn expect_or_die_perror_(self, msg: &str) -> T
anyhow library might be a better choiceAlias for ExpectedWithError::or_die_e_.
Sourcefn expect_or_die_perror<F>(self, msgf: F) -> T
๐Deprecated: This module is in maintenance mode; the anyhow library might be a better choice
fn expect_or_die_perror<F>(self, msgf: F) -> T
anyhow library might be a better choiceAlias for ExpectedWithError::or_die_e.
Dyn Compatibilityยง
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.