Trait Repr

Source
pub trait Repr<T>
where Self: Sized,
{ // Required methods fn from(v: T) -> Self; fn try_into(self) -> Result<T, Self>; fn can_into(&self) -> bool; }

Required Methods§

Source

fn from(v: T) -> Self

Convert a raw type to the common representation.

Source

fn try_into(self) -> Result<T, Self>

Try to convert the representation back into one of the raw message types.

Source

fn can_into(&self) -> bool

Check whether the representation can be turned into this raw type, without consuming.

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: Send + Sync + 'static> Repr<T> for BoxAnyRepr

Source§

impl<T: Serialize + DeserializeOwned + 'static> Repr<T> for JsonStringRepr