Skip to main content

MessageExt

Trait MessageExt 

Source
pub trait MessageExt: Message {
    // Required method
    fn to_bytes(&self) -> Result<Vec<u8>, EncodeError>;
}
Expand description

Extension trait for Message.

Required Methods§

Source

fn to_bytes(&self) -> Result<Vec<u8>, EncodeError>

Serialize this protobuf message as a byte vector.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<M> MessageExt for M
where M: Message,