Msg

Trait Msg 

Source
pub trait Msg:
    Clone
    + Sized
    + TryFrom<Self::Proto, Error = Self::Err>
    + TryInto<Self::Proto, Error = Self::Err> {
    type Proto: Default + MessageExt + Sized + TypeUrl;
    type Err: From<ChainError> + Debug + Display;

    // Provided methods
    fn from_any(any: &Any) -> Result<Self, Self::Err> { ... }
    fn to_any(&self) -> Result<Any, Self::Err> { ... }
    fn into_any(self) -> Result<Any, Self::Err> { ... }
}

Required Associated Types§

Source

type Proto: Default + MessageExt + Sized + TypeUrl

Protobuf type

Source

type Err: From<ChainError> + Debug + Display

Protobuf conversion error type

Provided Methods§

Source

fn from_any(any: &Any) -> Result<Self, Self::Err>

Parse this message proto from Any.

Source

fn to_any(&self) -> Result<Any, Self::Err>

Serialize this message proto as Any.

Source

fn into_any(self) -> Result<Any, Self::Err>

Convert this message proto into Any.

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§