AnyMessage

Trait AnyMessage 

Source
pub trait AnyMessage:
    Send
    + Sync
    + 'static {
    // Required methods
    fn new(&self) -> Box<dyn AnyMessage + 'static>;
    fn qualified_name(&self) -> &'static str;
    fn as_bin<'buf>(&self) -> &dyn BinProto<'buf>;
    fn as_bin_mut<'buf>(&mut self) -> &mut dyn BinProto<'buf>;
    fn as_text<'buf>(&self) -> &dyn TextProto<'buf>;
    fn as_text_mut<'buf>(&mut self) -> &mut dyn TextProto<'buf>;
}
Expand description

type-erased message that supports all formats of decoding & encoding

Required Methods§

Source

fn new(&self) -> Box<dyn AnyMessage + 'static>

Source

fn qualified_name(&self) -> &'static str

Source

fn as_bin<'buf>(&self) -> &dyn BinProto<'buf>

Source

fn as_bin_mut<'buf>(&mut self) -> &mut dyn BinProto<'buf>

Source

fn as_text<'buf>(&self) -> &dyn TextProto<'buf>

Source

fn as_text_mut<'buf>(&mut self) -> &mut dyn TextProto<'buf>

Trait Implementations§

Source§

impl<'buf> BinProto<'buf> for dyn AnyMessage

Source§

fn qualified_name(&self) -> &'static str

Source§

fn merge_field( &mut self, tag_wire: u32, stream: &mut InputStream<'buf>, ) -> Result<()>

Source§

fn size(&self, stack: &mut SizeStack) -> usize

Source§

fn encode(&self, stream: &mut OutputStream)

Source§

impl Clone for Box<dyn AnyMessage>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for dyn AnyMessage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'buf> TextProto<'buf> for dyn AnyMessage

Source§

fn merge_field(&mut self, stream: &mut InputStream<'buf>) -> Result<()>

Merge a single field into this message from input stream Read more
Source§

fn encode(&self, stream: &mut OutputStream<'_>)

Encode this message contents into the provided output stream

Implementors§

Source§

impl<T> AnyMessage for T
where T: for<'buf> BinProto<'buf> + for<'buf> TextProto<'buf> + Default + Debug + Send + Sync + 'static,