pub trait HandleStrategy<'a>: Send + Sync {
// Required methods
fn save_chunk(
&self,
chunk_data: &'a [u8],
chunk_index: usize,
) -> impl Future<Output = Result<(), ChunkStrategyError>> + Send;
fn merge_chunks(
&self,
) -> impl Future<Output = Result<(), ChunkStrategyError>> + Send;
}
Expand description
Trait for handling chunk operations.
Defines the interface for saving and merging file chunks.
Required Methods§
Sourcefn save_chunk(
&self,
chunk_data: &'a [u8],
chunk_index: usize,
) -> impl Future<Output = Result<(), ChunkStrategyError>> + Send
fn save_chunk( &self, chunk_data: &'a [u8], chunk_index: usize, ) -> impl Future<Output = Result<(), ChunkStrategyError>> + Send
Sourcefn merge_chunks(
&self,
) -> impl Future<Output = Result<(), ChunkStrategyError>> + Send
fn merge_chunks( &self, ) -> impl Future<Output = Result<(), ChunkStrategyError>> + Send
Merges all chunks into the final file.
§Returns
impl Future<Output = ChunkStrategyResult>
- Future of the merge operation.
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.
Implementors§
impl<'a> HandleStrategy<'a> for ChunkStrategy<'a>
Implementation of handle strategy for chunk operations.