mesh_node::message

Trait SerializeMessage

Source
pub trait SerializeMessage: 'static {
    type Concrete: Any;

    // Required methods
    fn compute_message_size(&mut self, sizer: MessageSizer<'_>);
    fn write_message(self, writer: MessageWriter<'_, '_, Resource>);
    fn extract(self) -> Self::Concrete;
}
Expand description

Trait implemented by concrete messages that can be extracted or serialized into SerializedMessage.

Required Associated Types§

Source

type Concrete: Any

The underlying concrete message type.

Required Methods§

Source

fn compute_message_size(&mut self, sizer: MessageSizer<'_>)

Computes the message size, as in MessageEncode::compute_message_size.

Source

fn write_message(self, writer: MessageWriter<'_, '_, Resource>)

Writes the message, as in MessageEncode::write_message.

Source

fn extract(self) -> Self::Concrete

Extract the concrete message.

Implementors§

Source§

impl<T: 'static + MeshPayload + Send> SerializeMessage for T