pub trait TryConvert<A, B> {
// Required method
fn try_convert(a: A) -> Result<B, A>;
}
Expand description
Fallible conversion trait which returns the argument in the case of being unable to convert. Generic over both source and destination types.
Required Methods§
Sourcefn try_convert(a: A) -> Result<B, A>
fn try_convert(a: A) -> Result<B, A>
Attempt to make conversion. If returning Result::Err, the inner must always be a
.
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.