pub trait KnetTransform: Copy + Sized {
// Required methods
fn serialize(&self) -> Vec<u8> ⓘ;
fn deserialize(&mut self, _: &[u8]);
fn get_size_of_payload() -> usize;
fn get_size_of_data(data: &[u8]) -> usize;
fn from_raw(_: &[u8]) -> Self;
}Required Methods§
Sourcefn deserialize(&mut self, _: &[u8])
fn deserialize(&mut self, _: &[u8])
Deserialize the data into a vector of byte
Sourcefn get_size_of_payload() -> usize
fn get_size_of_payload() -> usize
Get the size of the payload of the serialize data
Sourcefn get_size_of_data(data: &[u8]) -> usize
fn get_size_of_data(data: &[u8]) -> usize
Get size of the data followed by the payload
Note the data have to be the same size as the get_size_of_payload function
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.