Trait ambient_api::prelude::message::MessageSerde
source · pub trait MessageSerde: Default + Clone + Sized {
// Required methods
fn serialize_message_part(
&self,
output: &mut Vec<u8>
) -> Result<(), MessageSerdeError>;
fn deserialize_message_part(
input: &mut dyn Read
) -> Result<Self, MessageSerdeError>;
}
Expand description
Implemented for all types that can be serialized in a message.
Required Methods§
sourcefn serialize_message_part(
&self,
output: &mut Vec<u8>
) -> Result<(), MessageSerdeError>
fn serialize_message_part( &self, output: &mut Vec<u8> ) -> Result<(), MessageSerdeError>
Serialize this to a Vec<u8>
.
sourcefn deserialize_message_part(
input: &mut dyn Read
) -> Result<Self, MessageSerdeError>
fn deserialize_message_part( input: &mut dyn Read ) -> Result<Self, MessageSerdeError>
Deserialize this if possible.
Object Safety§
This trait is not object safe.