Struct mesh::payload::SerializedMessage
source · pub struct SerializedMessage<R = NoResources> {
pub data: Vec<u8>,
pub resources: Vec<R>,
}
Expand description
A serialized message, consisting of binary data and a list of resources.
Fields§
§data: Vec<u8>
The message data.
resources: Vec<R>
The message resources.
Implementations§
source§impl<R> SerializedMessage<R>
impl<R> SerializedMessage<R>
sourcepub fn from_message<T>(t: T) -> SerializedMessage<R>
pub fn from_message<T>(t: T) -> SerializedMessage<R>
Serializes a message.
sourcepub fn into_message<T>(self) -> Result<T, Error>
pub fn into_message<T>(self) -> Result<T, Error>
Deserializes a message.
Trait Implementations§
source§impl<R> Debug for SerializedMessage<R>where
R: Debug,
impl<R> Debug for SerializedMessage<R>where
R: Debug,
source§impl<R> Default for SerializedMessage<R>
impl<R> Default for SerializedMessage<R>
source§fn default() -> SerializedMessage<R>
fn default() -> SerializedMessage<R>
Returns the “default value” for a type. Read more
source§impl<R> DefaultEncoding for SerializedMessage<R>
impl<R> DefaultEncoding for SerializedMessage<R>
source§type Encoding = MessageEncoding<SerializedMessageEncoder>
type Encoding = MessageEncoding<SerializedMessageEncoder>
The encoding to use for the serialization. Read more
source§impl<R> MessageDecode<'_, SerializedMessage<R>, R> for SerializedMessageEncoder
impl<R> MessageDecode<'_, SerializedMessage<R>, R> for SerializedMessageEncoder
source§fn read_message(
item: &mut InplaceOption<'_, SerializedMessage<R>>,
reader: MessageReader<'_, '_, R>,
) -> Result<(), Error>
fn read_message( item: &mut InplaceOption<'_, SerializedMessage<R>>, reader: MessageReader<'_, '_, R>, ) -> Result<(), Error>
Reads a message into
item
.source§impl<R> MessageEncode<SerializedMessage<R>, R> for SerializedMessageEncoder
impl<R> MessageEncode<SerializedMessage<R>, R> for SerializedMessageEncoder
source§fn write_message(item: SerializedMessage<R>, writer: MessageWriter<'_, '_, R>)
fn write_message(item: SerializedMessage<R>, writer: MessageWriter<'_, '_, R>)
Writes
item
as a message.source§fn compute_message_size(
item: &mut SerializedMessage<R>,
sizer: MessageSizer<'_>,
)
fn compute_message_size( item: &mut SerializedMessage<R>, sizer: MessageSizer<'_>, )
Computes the size of
item
as a message. Read moreAuto Trait Implementations§
impl<R> Freeze for SerializedMessage<R>
impl<R> RefUnwindSafe for SerializedMessage<R>where
R: RefUnwindSafe,
impl<R> Send for SerializedMessage<R>where
R: Send,
impl<R> Sync for SerializedMessage<R>where
R: Sync,
impl<R> Unpin for SerializedMessage<R>where
R: Unpin,
impl<R> UnwindSafe for SerializedMessage<R>where
R: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> SerializeMessage for Twhere
T: MeshPayload,
impl<T> SerializeMessage for Twhere
T: MeshPayload,
source§fn compute_message_size(&mut self, sizer: MessageSizer<'_>)
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>)
fn write_message(self, writer: MessageWriter<'_, '_, Resource>)
Writes the message, as in
MessageEncode::write_message
.source§fn extract(self) -> <T as SerializeMessage>::Concrete
fn extract(self) -> <T as SerializeMessage>::Concrete
Extract the concrete message.