Trait prost::Message
[−]
[src]
pub trait Message: Debug + Default + PartialEq + Send + Sync { fn merge<B>(&mut self, buf: &mut Take<B>) -> Result<()>
where
B: Buf; fn encoded_len(&self) -> usize; fn encode<B>(&self, buf: &mut B) -> Result<()>
where
B: BufMut, { ... } fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<()>
where
B: BufMut, { ... } fn decode<B>(buf: &mut Take<B>) -> Result<Self>
where
B: Buf,
Self: Default, { ... } fn decode_length_delimited<B>(buf: &mut B) -> Result<Self>
where
B: Buf,
Self: Default, { ... } fn merge_length_delimited<B>(&mut self, buf: &mut B) -> Result<()>
where
B: Buf, { ... } }
A Protocol Buffers message.
Required Methods
fn merge<B>(&mut self, buf: &mut Take<B>) -> Result<()> where
B: Buf,
B: Buf,
Decodes an instance of the message from the buffer, and merges
it into self
. The entire buffer will be consumed.
fn encoded_len(&self) -> usize
The encoded length of the message without a length delimiter.
Provided Methods
fn encode<B>(&self, buf: &mut B) -> Result<()> where
B: BufMut,
B: BufMut,
Encodes the message, and writes it to the buffer. An error will be returned if the buffer does not have sufficient capacity.
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<()> where
B: BufMut,
B: BufMut,
Encodes the message, and writes it with a length-delimiter prefix to the buffer. An error will be returned if the buffer does not have sufficient capacity.
fn decode<B>(buf: &mut Take<B>) -> Result<Self> where
B: Buf,
Self: Default,
B: Buf,
Self: Default,
Decodes an instance of the message from the buffer. The entire buffer will be consumed.
fn decode_length_delimited<B>(buf: &mut B) -> Result<Self> where
B: Buf,
Self: Default,
B: Buf,
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
fn merge_length_delimited<B>(&mut self, buf: &mut B) -> Result<()> where
B: Buf,
B: Buf,
Decodes a length-delimited instance of the message from the
buffer, and merges it into self
.