Struct copra::codec::ProtobufCodec
[−]
[src]
pub struct ProtobufCodec<T, U> { /* fields omitted */ }
Codec for protobuf messages
Methods
impl<T, U> ProtobufCodec<T, U>
[src]
Trait Implementations
impl<T: Clone, U: Clone> Clone for ProtobufCodec<T, U>
[src]
fn clone(&self) -> ProtobufCodec<T, U>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: Debug, U: Debug> Debug for ProtobufCodec<T, U>
[src]
impl<T, U> MethodCodec for ProtobufCodec<T, U> where
T: Message + MessageStatic,
U: Message,
[src]
T: Message + MessageStatic,
U: Message,
type Request = T
Request message decoded from raw bytes
type Response = U
Response message for encoding to raw bytes
type Error = ProtobufError
Error during decoding or encoding
fn decode(&self, buf: Bytes) -> Result<Self::Request, Self::Error>
[src]
Decode message from bytes.
fn encode(&self, msg: Self::Response) -> Result<Bytes, Self::Error>
[src]
Encode message to bytes.