Trait penumbra_proto::DomainType

source ·
pub trait DomainType
where Self: Clone + Sized + TryFrom<Self::Proto>, Self::Proto: Name + Message + Default + From<Self> + Send + Sync + 'static, Error: From<<Self as TryFrom<Self::Proto>>::Error>,
{ type Proto; // Provided methods fn encode_to_vec(&self) -> Vec<u8> { ... } fn to_proto(&self) -> Self::Proto { ... } fn decode<B: Buf>(buf: B) -> Result<Self> { ... } }
Expand description

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

Required Associated Types§

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>(buf: B) -> Result<Self>

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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl DomainType for PublicKey

source§

impl DomainType for Clue

§

type Proto = Clue

source§

impl DomainType for Signature<Binding>

source§

impl DomainType for Signature<SpendAuth>

source§

impl DomainType for VerificationKey<SpendAuth>

source§

impl DomainType for ChannelEnd

§

type Proto = Channel

source§

impl DomainType for ClientPaths

§

type Proto = ClientPaths

source§

impl DomainType for ClientState

§

type Proto = Any

source§

impl DomainType for ConnectionEnd

§

type Proto = ConnectionEnd

source§

impl DomainType for ConsensusState

§

type Proto = Any

source§

impl DomainType for Height

§

type Proto = Height

Implementors§