Trait zksync_protobuf::ProtoFmt

source ·
pub trait ProtoFmt: Sized {
    type Proto: ReflectMessage + Default;

    // Required methods
    fn read(r: &Self::Proto) -> Result<Self>;
    fn build(&self) -> Self::Proto;
}
Expand description

Trait defining a proto representation for a type.

Required Associated Types§

source

type Proto: ReflectMessage + Default

Proto message type representing Self.

Required Methods§

source

fn read(r: &Self::Proto) -> Result<Self>

Converts Proto to Self.

source

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

Converts Self to Proto.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ProtoFmt for SocketAddr

source§

type Proto = SocketAddr

source§

fn read(r: &Self::Proto) -> Result<Self>

source§

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

source§

impl ProtoFmt for ()

source§

type Proto = Void

source§

fn read(_r: &Self::Proto) -> Result<Self>

source§

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

source§

impl ProtoFmt for BitVec

source§

type Proto = BitVector

source§

fn read(r: &Self::Proto) -> Result<Self>

source§

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

source§

impl ProtoFmt for Rate

source§

type Proto = RateLimit

source§

fn read(r: &Self::Proto) -> Result<Self>

source§

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

source§

impl ProtoFmt for Utc

source§

type Proto = Timestamp

source§

fn read(r: &Self::Proto) -> Result<Self>

source§

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

source§

impl ProtoFmt for Duration

source§

type Proto = Duration

source§

fn read(r: &Self::Proto) -> Result<Self>

source§

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

Implementors§