pub trait ToBytes {
// Required method
fn to_bytes(self) -> Bytes;
}Expand description
A trait for types that can be converted to the Bytes type.
This trait is implemented for various types such as Vec<u8>, String, &str, and primitive types like u8, i32, etc.
Additionally it supports an JSON serializable type via the serde and serde_json crates.