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 empty_chunk<const BS: usize>( ) -> Result<(ContentChunk<BS>, Self::RootRef)>;
fn extract_root(buffer: &[u8]) -> Result<Self::RootRef>;
}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), returning chunk and reference bytes. Takes ownership of the payload to avoid an extra allocation.
Sourcefn empty_chunk<const BS: usize>() -> Result<(ContentChunk<BS>, Self::RootRef)>
fn empty_chunk<const BS: usize>() -> Result<(ContentChunk<BS>, Self::RootRef)>
Produce the chunk for an empty file, returning it and the 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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".