pub trait SplitMode: JoinMode {
type RefBytes: AsRef<[u8]> + AsMut<[u8]> + Clone + Debug + Send + Sync;
// Required methods
fn prepare_chunk<const BS: usize>(
data: Vec<u8>,
) -> Result<(ContentChunk<BS>, Self::RefBytes)>;
fn process_empty<const BS: usize, S: SyncChunkPut<BS>>(
store: &S,
) -> Result<Self::RootRef>;
fn extract_root(buffer: &[u8]) -> Result<Self::RootRef>;
// Provided method
fn process_chunk<const BS: usize, S: SyncChunkPut<BS>>(
data: Vec<u8>,
store: &S,
) -> Result<Self::RefBytes> { ... }
}Expand description
Splitter-side chunk mode operations (extends JoinMode).
Required Associated Types§
Required Methods§
Sourcefn prepare_chunk<const BS: usize>(
data: Vec<u8>,
) -> Result<(ContentChunk<BS>, Self::RefBytes)>
fn prepare_chunk<const BS: usize>( data: Vec<u8>, ) -> Result<(ContentChunk<BS>, Self::RefBytes)>
Prepare chunk data (span + body) for storage, returning chunk and reference bytes. Takes ownership of the payload to avoid an extra allocation.
Sourcefn process_empty<const BS: usize, S: SyncChunkPut<BS>>(
store: &S,
) -> Result<Self::RootRef>
fn process_empty<const BS: usize, S: SyncChunkPut<BS>>( store: &S, ) -> Result<Self::RootRef>
Process empty file, store chunk, return root ref.
Sourcefn extract_root(buffer: &[u8]) -> Result<Self::RootRef>
fn extract_root(buffer: &[u8]) -> Result<Self::RootRef>
Extract root reference from top of buffer.
Provided Methods§
Sourcefn process_chunk<const BS: usize, S: SyncChunkPut<BS>>(
data: Vec<u8>,
store: &S,
) -> Result<Self::RefBytes>
fn process_chunk<const BS: usize, S: SyncChunkPut<BS>>( data: Vec<u8>, store: &S, ) -> Result<Self::RefBytes>
Process chunk data (span + body), store it, return reference bytes. Takes ownership of the payload to avoid an extra allocation.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".