pub trait PacketVariable {
// Required methods
fn from_packet(bytes: Vec<u8>) -> (Self, usize)
where Self: Sized;
fn to_packet(&self) -> Vec<u8> ⓘ;
}Required Methods§
Sourcefn from_packet(bytes: Vec<u8>) -> (Self, usize)where
Self: Sized,
fn from_packet(bytes: Vec<u8>) -> (Self, usize)where
Self: Sized,
Reads a variable from the beginning of the given bytes vector
§Arguments
fn to_packet(&self) -> Vec<u8> ⓘ
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".