Skip to main content

RawMessage

Trait RawMessage 

Source
pub trait RawMessage: EmptyState {
    const __ASSERTIONS: ();

    // Required methods
    fn raw_encode<B: BufMut + ?Sized>(&self, buf: &mut B);
    fn raw_prepend<B: ReverseBuf + ?Sized>(&self, buf: &mut B);
    fn raw_encoded_len(&self) -> usize;
}
Expand description

Encoding trait to be implemented by messages. The methods of this trait are meant to only be used by the Message implementation.

Required Associated Constants§

Required Methods§

Source

fn raw_encode<B: BufMut + ?Sized>(&self, buf: &mut B)

Encodes the message to a buffer.

This method will panic if the buffer has insufficient capacity.

Source

fn raw_prepend<B: ReverseBuf + ?Sized>(&self, buf: &mut B)

Prepends the message to a prepend buffer.

Source

fn raw_encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl RawMessage for ()

The empty tuple unit is the only native tuple type that implements Message because there are no choices to be made about how its fields will be encoded. All other native tuples are only implemented as field values. They encode exactly as if they were nested messages, but their encoding must be specified.

Source§

impl<T> RawMessage for Box<T>
where T: RawMessage,

Implementors§