pub trait IntoResult {
type Value;
type Error;
// Required method
fn into_result(self) -> Result<Self::Value, Self::Error>;
}Expand description
Tells the bind macro whether the given expression yielded a bindable value or an error.
Enables the bind macro to determine by representing the value yielded
by the given expression as Result whether to create a variable and bind it to the value,
or to call the optional error handler and evaluate the execution flow control block.
Implemented by default for Result and Option, with () as Error for the latter.
For the usage example, refer to the bind macro documentation, which includes
an example of using it with user-defined types.
Required Associated Types§
Required Methods§
Sourcefn into_result(self) -> Result<Self::Value, Self::Error>
fn into_result(self) -> Result<Self::Value, Self::Error>
Represents the yielded value as Result