Trait ibc_types::DomainType

source ·
pub trait DomainType: Clone + Sized + TryFrom<Self::Proto>where
    Self::Error: Into<Error> + Send + Sync + 'static,{
    type Proto: Message + Name + Default + From<Self> + Send + Sync + 'static;

    // Provided methods
    fn encode_to_vec(&self) -> Vec<u8> { ... }
    fn to_proto(&self) -> Self::Proto { ... }
    fn decode<B>(buf: B) -> Result<Self, Error>
       where B: Buf { ... }
}
Expand description

A marker type that captures the relationships between a domain type (Self) and a protobuf type (Self::Proto).

Required Associated Types§

source

type Proto: Message + Name + Default + From<Self> + Send + Sync + 'static

Provided Methods§

source

fn encode_to_vec(&self) -> Vec<u8>

Encode this domain type to a byte vector, via proto type P.

source

fn to_proto(&self) -> Self::Proto

Convert this domain type to the associated proto type.

This uses the From impl internally, so it works exactly like .into(), but does not require type inference.

source

fn decode<B>(buf: B) -> Result<Self, Error>where B: Buf,

Decode this domain type from a byte buffer, via proto type P.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl DomainType for MsgAcknowledgement

§

type Proto = MsgAcknowledgement

source§

impl DomainType for MsgChannelCloseConfirm

§

type Proto = MsgChannelCloseConfirm

source§

impl DomainType for MsgChannelCloseInit

§

type Proto = MsgChannelCloseInit

source§

impl DomainType for MsgChannelOpenAck

§

type Proto = MsgChannelOpenAck

source§

impl DomainType for MsgChannelOpenConfirm

§

type Proto = MsgChannelOpenConfirm

source§

impl DomainType for MsgChannelOpenInit

§

type Proto = MsgChannelOpenInit

source§

impl DomainType for MsgChannelOpenTry

§

type Proto = MsgChannelOpenTry

source§

impl DomainType for MsgRecvPacket

§

type Proto = MsgRecvPacket

source§

impl DomainType for MsgTimeout

§

type Proto = MsgTimeout

source§

impl DomainType for MsgTimeoutOnClose

§

type Proto = MsgTimeoutOnClose

source§

impl DomainType for MsgCreateClient

§

type Proto = MsgCreateClient

source§

impl DomainType for MsgSubmitMisbehaviour

§

type Proto = MsgSubmitMisbehaviour

source§

impl DomainType for MsgUpdateClient

§

type Proto = MsgUpdateClient

source§

impl DomainType for MsgUpgradeClient

§

type Proto = MsgUpgradeClient

source§

impl DomainType for MerklePath

§

type Proto = MerklePath

source§

impl DomainType for MerklePrefix

§

type Proto = MerklePrefix

source§

impl DomainType for MerkleProof

§

type Proto = MerkleProof

source§

impl DomainType for MerkleRoot

§

type Proto = MerkleRoot

source§

impl DomainType for MsgConnectionOpenAck

§

type Proto = MsgConnectionOpenAck

source§

impl DomainType for MsgConnectionOpenConfirm

§

type Proto = MsgConnectionOpenConfirm

source§

impl DomainType for MsgConnectionOpenInit

§

type Proto = MsgConnectionOpenInit

source§

impl DomainType for MsgConnectionOpenTry

§

type Proto = MsgConnectionOpenTry

source§

impl DomainType for ClientPaths

§

type Proto = ClientPaths

source§

impl DomainType for IdentifiedConnectionEnd

§

type Proto = IdentifiedConnection

source§

impl DomainType for ClientState

§

type Proto = Any

source§

impl DomainType for ConsensusState

§

type Proto = Any