TryIntoNative

Trait TryIntoNative 

Source
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§

Source

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.

Implementors§

Source§

impl<T, U> TryIntoNative<U> for T
where U: TryFromProto<T>,