pub trait AsBytes {
// Required method
fn as_bytes(&self) -> Vec<u8> ⓘ;
}
Expand description
Used to convert struct to raw bytes to be sent over the network
Example:
// We have some struct S that implements this trait
let s = S::new();
// This prints the raw bytes as debug output
dbg!("{}", s.as_bytes());