surrealcs_kernel/messages/serialization/traits.rs
//! Definitions of serialization traits for messages.
pub trait IntoVecBytes: Sized {
fn to_be_bytes(a: Self) -> Vec<u8>;
}
impl IntoVecBytes for u16 {
fn to_be_bytes(a: u16) -> Vec<u8> {
a.to_be_bytes().to_vec()
}
}
impl IntoVecBytes for usize {
fn to_be_bytes(a: usize) -> Vec<u8> {
a.to_be_bytes().to_vec()
}
}