ByteArraySerializeDeserialize

Trait ByteArraySerializeDeserialize 

Source
pub trait ByteArraySerializeDeserialize: Serialize + for<'a> Deserialize<'a> {
    // Provided methods
    fn into_serialized(self) -> Vec<u8>  { ... }
    fn try_from_serialized(serialized_msg: Vec<u8>) -> Result<Self, Error> { ... }
}
Expand description

A trait for types that can be serialized to and deserialized from byte arrays.

Implement using #[derive(ByteArrayToFromZMQ)].

§Methods

  • into_zmq_message: Serializes the implementing type to a byte array Vec<u8>.
  • try_from_zmq_message: Attempts to create an instance of the implementing type from a given Vec<u8> by deserializing the byte array contained within.

Provided Methods§

Source

fn into_serialized(self) -> Vec<u8>

Source

fn try_from_serialized(serialized_msg: Vec<u8>) -> Result<Self, Error>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§