Struct mesh_protobuf::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: DefaultEncoding>(t: T) -> Selfwhere
T::Encoding: MessageEncode<T, R>,
pub fn from_message<T: DefaultEncoding>(t: T) -> Selfwhere
T::Encoding: MessageEncode<T, R>,
Serializes a message.
sourcepub fn into_message<T: DefaultEncoding>(self) -> Result<T>where
T::Encoding: for<'a> MessageDecode<'a, T, R>,
pub fn into_message<T: DefaultEncoding>(self) -> Result<T>where
T::Encoding: for<'a> MessageDecode<'a, T, R>,
Deserializes a message.
Trait Implementations§
source§impl<R: Debug> Debug for SerializedMessage<R>
impl<R: Debug> Debug for SerializedMessage<R>
source§impl<R> Default for SerializedMessage<R>
impl<R> Default for SerializedMessage<R>
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<()>
fn read_message( item: &mut InplaceOption<'_, SerializedMessage<R>>, reader: MessageReader<'_, '_, R>, ) -> Result<()>
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