Trait BytesConvertable

Source
pub trait BytesConvertable {
    // Required methods
    fn into_bytes(self) -> Vec<u8> ;
    fn from_bytes(bytes: Vec<u8>) -> Self;
}
Expand description

Trait for use with ractor_cluster_derive::RactorClusterMessage derive macro. It defines argument and reply message types which are serializable to/from byte payloads so code can be autogenerated for you by macros for over-the-wire message formats between actors

Required Methods§

Source

fn into_bytes(self) -> Vec<u8>

Serialize this type to a vector of bytes. Panics are acceptable

Source

fn from_bytes(bytes: Vec<u8>) -> Self

Deserialize this type from a vector of bytes. Panics are acceptable

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.

Implementations on Foreign Types§

Source§

impl BytesConvertable for bool

Source§

impl BytesConvertable for char

Source§

impl BytesConvertable for f32

Source§

impl BytesConvertable for f64

Source§

impl BytesConvertable for i8

Source§

fn into_bytes(self) -> Vec<u8>

Source§

fn from_bytes(bytes: Vec<u8>) -> i8

Source§

impl BytesConvertable for i16

Source§

impl BytesConvertable for i32

Source§

impl BytesConvertable for i64

Source§

impl BytesConvertable for i128

Source§

impl BytesConvertable for u8

Source§

fn into_bytes(self) -> Vec<u8>

Source§

fn from_bytes(bytes: Vec<u8>) -> u8

Source§

impl BytesConvertable for u16

Source§

impl BytesConvertable for u32

Source§

impl BytesConvertable for u64

Source§

impl BytesConvertable for u128

Source§

impl BytesConvertable for ()

Source§

impl BytesConvertable for String

Source§

impl BytesConvertable for Vec<bool>

Source§

impl BytesConvertable for Vec<char>

Source§

impl BytesConvertable for Vec<f32>

Source§

impl BytesConvertable for Vec<f64>

Source§

impl BytesConvertable for Vec<i8>

Source§

fn into_bytes(self) -> Vec<u8>

Source§

fn from_bytes(bytes: Vec<u8>) -> Vec<i8>

Source§

impl BytesConvertable for Vec<i16>

Source§

impl BytesConvertable for Vec<i32>

Source§

impl BytesConvertable for Vec<i64>

Source§

impl BytesConvertable for Vec<i128>

Source§

impl BytesConvertable for Vec<u8>

Source§

impl BytesConvertable for Vec<u16>

Source§

impl BytesConvertable for Vec<u32>

Source§

impl BytesConvertable for Vec<u64>

Source§

impl BytesConvertable for Vec<u128>

Implementors§