Trait ToBytes

Source
pub trait ToBytes {
    // Required method
    fn to_bytes(&self) -> Result<Vec<u8>, Box<dyn Error + Sync + Send>>;
}
Expand description

The ToBytes trait needs to be implemented by all types that need to be encoded.

Required Methods§

Source

fn to_bytes(&self) -> Result<Vec<u8>, Box<dyn Error + Sync + Send>>

Implementations on Foreign Types§

Source§

impl ToBytes for bool

Source§

fn to_bytes(&self) -> Result<Vec<u8>, Box<dyn Error + Sync + Send>>

Source§

impl ToBytes for f32

Source§

fn to_bytes(&self) -> Result<Vec<u8>, Box<dyn Error + Sync + Send>>

Source§

impl ToBytes for f64

Source§

fn to_bytes(&self) -> Result<Vec<u8>, Box<dyn Error + Sync + Send>>

Source§

impl ToBytes for i16

Source§

fn to_bytes(&self) -> Result<Vec<u8>, Box<dyn Error + Sync + Send>>

Source§

impl ToBytes for i32

Source§

fn to_bytes(&self) -> Result<Vec<u8>, Box<dyn Error + Sync + Send>>

Source§

impl ToBytes for i64

Source§

fn to_bytes(&self) -> Result<Vec<u8>, Box<dyn Error + Sync + Send>>

Source§

impl ToBytes for str

Source§

fn to_bytes(&self) -> Result<Vec<u8>, Box<dyn Error + Sync + Send>>

Source§

impl ToBytes for u8

Source§

fn to_bytes(&self) -> Result<Vec<u8>, Box<dyn Error + Sync + Send>>

Source§

impl ToBytes for ()

Source§

fn to_bytes(&self) -> Result<Vec<u8>, Box<dyn Error + Sync + Send>>

Source§

impl ToBytes for String

Source§

fn to_bytes(&self) -> Result<Vec<u8>, Box<dyn Error + Sync + Send>>

Source§

impl<T: ToBytes> ToBytes for Option<T>

Source§

fn to_bytes(&self) -> Result<Vec<u8>, Box<dyn Error + Sync + Send>>

Source§

impl<T: ToBytes> ToBytes for Vec<T>

Source§

fn to_bytes(&self) -> Result<Vec<u8>, Box<dyn Error + Sync + Send>>

Source§

impl<T: ToBytes, U: ToBytes> ToBytes for HashMap<T, U>

Source§

fn to_bytes(&self) -> Result<Vec<u8>, Box<dyn Error + Sync + Send>>

Implementors§