Skip to main content

ToBytes

Trait ToBytes 

Source
pub trait ToBytes {
    // Required method
    fn to_bytes(&self) -> &[u8] ;

    // Provided method
    fn to_bytes_owned(&self) -> Vec<u8>  { ... }
}

Required Methods§

Source

fn to_bytes(&self) -> &[u8]

Convert the struct to its binary representation

Provided Methods§

Source

fn to_bytes_owned(&self) -> Vec<u8>

Convert the struct to an owned Vec

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§