pub trait TryIntoNative<N>: Sized {
// Required method
fn try_into_native(self) -> Result<N, ProstConvertError>;
}Expand description
An attempted conversion that consumes self, which may or may not be
expensive.
Library authors should usually not directly implement this trait,
but should prefer implementing the TryFromProto trait, which offers
greater flexibility and provides an equivalent TryIntoNative
implementation for free, thanks to a blanket implementation in this
crate.
Required Methods§
Sourcefn try_into_native(self) -> Result<N, ProstConvertError>
fn try_into_native(self) -> Result<N, ProstConvertError>
Performs the conversion.
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.