pub trait Try {
type Ok;
type Error;
// Required methods
fn into_result(self) -> Result<Self::Ok, Self::Error>;
fn from_error(v: Self::Error) -> Self;
fn from_ok(v: Self::Ok) -> Self;
}
Expand description
A stable version of core::ops::Try
.
Required Associated Types§
Required Methods§
Sourcefn into_result(self) -> Result<Self::Ok, Self::Error>
fn into_result(self) -> Result<Self::Ok, Self::Error>
A return of Ok(t)
means that the
execution should continue normally, and the result of ?
is the
value t
. A return of Err(e)
means that execution should branch
to the innermost enclosing catch
, or return from the function.
Sourcefn from_error(v: Self::Error) -> Self
fn from_error(v: Self::Error) -> Self
Wrap an error value to construct the composite result. For example,
Result::Err(x)
and Result::from_error(x)
are equivalent.
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.