pub trait BoxedSliceEncodable: CompactEncoding {
// Required method
fn boxed_slice_encoded_size(
boxed: &Box<[Self]>,
) -> Result<usize, EncodingError>
where Self: Sized;
// Provided methods
fn boxed_slice_encode<'a>(
vec: &Box<[Self]>,
buffer: &'a mut [u8],
) -> Result<&'a mut [u8], EncodingError>
where Self: Sized { ... }
fn boxed_slice_decode(
buffer: &[u8],
) -> Result<(Box<[Self]>, &[u8]), EncodingError>
where Self: Sized { ... }
}
Expand description
Define this trait for T
to get impl Box<[T]> for CompactEncoding
Required Methods§
Sourcefn boxed_slice_encoded_size(boxed: &Box<[Self]>) -> Result<usize, EncodingError>where
Self: Sized,
fn boxed_slice_encoded_size(boxed: &Box<[Self]>) -> Result<usize, EncodingError>where
Self: Sized,
The encoded size in bytes
Provided Methods§
Sourcefn boxed_slice_encode<'a>(
vec: &Box<[Self]>,
buffer: &'a mut [u8],
) -> Result<&'a mut [u8], EncodingError>where
Self: Sized,
fn boxed_slice_encode<'a>(
vec: &Box<[Self]>,
buffer: &'a mut [u8],
) -> Result<&'a mut [u8], EncodingError>where
Self: Sized,
Encode Box<[Self]>
to the buffer and return the remainder of the buffer
Sourcefn boxed_slice_decode(
buffer: &[u8],
) -> Result<(Box<[Self]>, &[u8]), EncodingError>where
Self: Sized,
fn boxed_slice_decode(
buffer: &[u8],
) -> Result<(Box<[Self]>, &[u8]), EncodingError>where
Self: Sized,
Decode [Box<[Self]>
] from buffer
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.