pub trait BucketItemSerializer {
type InputElementType<'a>: ?Sized;
type ExtraData;
type ReadBuffer: Default;
type ExtraDataBuffer: Default;
type ReadType<'a>;
type InitData;
type CheckpointData: Encode + Decode<()> + 'static;
// Required methods
fn new(init_data: Self::InitData) -> Self;
fn reset(&mut self);
fn write_to(
&mut self,
element: &Self::InputElementType<'_>,
bucket: &mut Vec<u8>,
extra_data: &Self::ExtraData,
extra_read_buffer: &Self::ExtraDataBuffer,
);
fn read_from<'a, S: Read>(
&mut self,
stream: S,
read_buffer: &'a mut Self::ReadBuffer,
extra_read_buffer: &mut Self::ExtraDataBuffer,
) -> Option<Self::ReadType<'a>>;
fn get_size(
&self,
element: &Self::InputElementType<'_>,
extra: &Self::ExtraData,
) -> usize;
}
Required Associated Types§
type InputElementType<'a>: ?Sized
type ExtraData
type ReadBuffer: Default
type ExtraDataBuffer: Default
type ReadType<'a>
type InitData
type CheckpointData: Encode + Decode<()> + 'static
Required Methods§
fn write_to( &mut self, element: &Self::InputElementType<'_>, bucket: &mut Vec<u8>, extra_data: &Self::ExtraData, extra_read_buffer: &Self::ExtraDataBuffer, )
fn read_from<'a, S: Read>( &mut self, stream: S, read_buffer: &'a mut Self::ReadBuffer, extra_read_buffer: &mut Self::ExtraDataBuffer, ) -> Option<Self::ReadType<'a>>
fn get_size( &self, element: &Self::InputElementType<'_>, extra: &Self::ExtraData, ) -> usize
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.