pub trait IntoResult {
type Value;
type Error;
// Required method
fn into_result(self) -> Result<Self::Value, Self::Error>;
}Expand description
Tells the crate::bind! macro whether the given expression has a bindable value or an error.
Enables the crate::bind! macro to determine by representing the value as a 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 crate::bind! macro documentation, which includes
an example of using it with user-defined types.
Required Associated Types§
Sourcetype Value
type Value
Type of the value that the crate::bind! macro binds the created variable to.
Sourcetype Error
type Error
Type of the error that the crate::bind! macro passes as the only argument
to the optional error handler.