pub trait Convert<Input> {
type Output;
type Error;
// Required method
fn try_convert(&mut self, input: Input) -> Result<Self::Output, Self::Error>;
}Expand description
Fallible conversion from one type to another.
Required Associated Types§
Required Methods§
Sourcefn try_convert(&mut self, input: Input) -> Result<Self::Output, Self::Error>
fn try_convert(&mut self, input: Input) -> Result<Self::Output, Self::Error>
Try to convert an instance of the input type to the output type. The conversion may fail, in which case an error is returned.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".