pub trait ResultExt {
type Success;
type Error: Error + Send + Sync + 'static;
// Required methods
fn or_raise<A, F>(self, err: F) -> Result<Self::Success, Exn<A>>
where A: Error + Send + Sync + 'static,
F: FnOnce() -> A;
fn or_erased(self) -> Result<Self::Success, Exn>;
fn or_raise_erased<A, F>(self, err: F) -> Result<Self::Success, Exn>
where A: Error + Send + Sync + 'static,
F: FnOnce() -> A;
}Required Associated Types§
Required Methods§
Sourcefn or_raise<A, F>(self, err: F) -> Result<Self::Success, Exn<A>>
fn or_raise<A, F>(self, err: F) -> Result<Self::Success, Exn<A>>
Raise a new exception on the Exn inside the Result.
Apply Exn::raise on the Err variant, refer to it for more information.
Sourcefn or_erased(self) -> Result<Self::Success, Exn>
fn or_erased(self) -> Result<Self::Success, Exn>
Raise a new exception on the Exn inside the Result, but erase its type.
Apply Exn::erased on the Err variant, refer to it for more information.
Sourcefn or_raise_erased<A, F>(self, err: F) -> Result<Self::Success, Exn>
fn or_raise_erased<A, F>(self, err: F) -> Result<Self::Success, Exn>
Raise a new exception on the Exn inside the Result, and type-erase the result.
Apply Exn::raise and Exn::erased on the Err variant, refer to it for more information.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".