pub trait RequestSerialize: RequestCommon {
// Provided methods
fn serialize_request(&self) -> Vec<u8> ⓘ { ... }
fn serialized_request_size(&self) -> usize { ... }
fn deserialize_request(buffer: &[u8]) -> Result<Self, DeserializeError> { ... }
}Provided Methods§
Sourcefn serialize_request(&self) -> Vec<u8> ⓘ
fn serialize_request(&self) -> Vec<u8> ⓘ
Serializes a request. A serialized request is composed of:
- A variable sized integer for the Type ID of the request
- Serialized content of the inner type.
Sourcefn serialized_request_size(&self) -> usize
fn serialized_request_size(&self) -> usize
Computes the size in bytes of a serialized request. A serialized request is composed of:
- A 2 bytes (u16) for the Type ID of the request
- Serialized content of the inner type.
Sourcefn deserialize_request(buffer: &[u8]) -> Result<Self, DeserializeError>
fn deserialize_request(buffer: &[u8]) -> Result<Self, DeserializeError>
Deserializes a request A serialized request is composed of:
- A variable sized integer for the Type ID of the request
- Serialized content of the inner type.
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.