pub trait ByteEncodable {
// Required methods
fn get_size<Size>(&self) -> Option<Size>
where Size: BVSize + ByteEncodable;
fn encode<Size>(&self) -> BVEncodeResult<Vec<u8>>
where Size: BVSize + ByteEncodable;
}Expand description
Provides serialization functionality for the implementing types.
Required Methods§
Sourcefn get_size<Size>(&self) -> Option<Size>where
Size: BVSize + ByteEncodable,
fn get_size<Size>(&self) -> Option<Size>where
Size: BVSize + ByteEncodable,
Returns the total length of the byte buffer
than can be obtained through the encode method
Sourcefn encode<Size>(&self) -> BVEncodeResult<Vec<u8>>where
Size: BVSize + ByteEncodable,
fn encode<Size>(&self) -> BVEncodeResult<Vec<u8>>where
Size: BVSize + ByteEncodable,
Returs a byte representation of the original data object
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.