ibc_types

Trait DomainType

pub trait DomainType:
    Sized
    + Clone
    + 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§

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

Provided Methods§

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

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

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.

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

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

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§

§

impl DomainType for MsgAcknowledgement

§

type Proto = MsgAcknowledgement

§

impl DomainType for MsgChannelCloseConfirm

§

type Proto = MsgChannelCloseConfirm

§

impl DomainType for MsgChannelCloseInit

§

type Proto = MsgChannelCloseInit

§

impl DomainType for MsgChannelOpenAck

§

type Proto = MsgChannelOpenAck

§

impl DomainType for MsgChannelOpenConfirm

§

type Proto = MsgChannelOpenConfirm

§

impl DomainType for MsgChannelOpenInit

§

type Proto = MsgChannelOpenInit

§

impl DomainType for MsgChannelOpenTry

§

type Proto = MsgChannelOpenTry

§

impl DomainType for MsgRecvPacket

§

type Proto = MsgRecvPacket

§

impl DomainType for MsgTimeout

§

type Proto = MsgTimeout

§

impl DomainType for MsgTimeoutOnClose

§

type Proto = MsgTimeoutOnClose

§

impl DomainType for MsgCreateClient

§

type Proto = MsgCreateClient

§

impl DomainType for MsgSubmitMisbehaviour

§

type Proto = MsgSubmitMisbehaviour

§

impl DomainType for MsgUpdateClient

§

type Proto = MsgUpdateClient

§

impl DomainType for MsgUpgradeClient

§

type Proto = MsgUpgradeClient

§

impl DomainType for MerklePath

§

type Proto = MerklePath

§

impl DomainType for MerklePrefix

§

type Proto = MerklePrefix

§

impl DomainType for MerkleProof

§

type Proto = MerkleProof

§

impl DomainType for MerkleRoot

§

type Proto = MerkleRoot

§

impl DomainType for MsgConnectionOpenAck

§

type Proto = MsgConnectionOpenAck

§

impl DomainType for MsgConnectionOpenConfirm

§

type Proto = MsgConnectionOpenConfirm

§

impl DomainType for MsgConnectionOpenInit

§

type Proto = MsgConnectionOpenInit

§

impl DomainType for MsgConnectionOpenTry

§

type Proto = MsgConnectionOpenTry

§

impl DomainType for ClientPaths

§

type Proto = ClientPaths

§

impl DomainType for IdentifiedConnectionEnd

§

type Proto = IdentifiedConnection

§

impl DomainType for ClientState

§

type Proto = Any

§

impl DomainType for ConsensusState

§

type Proto = Any