Trait asuran::chunker::AsyncChunker [−][src]
pub trait AsyncChunker: Chunker + Send + Sync {
fn async_chunk_boxed(
&self,
read: Box<dyn Read + Send + 'static, Global>,
queue_depth: usize
) -> Receiver<Result<Vec<u8, Global>, ChunkerError>>;
fn async_chunk<R>(
&self,
read: R,
queue_depth: usize
) -> Receiver<Result<Vec<u8, Global>, ChunkerError>>
where
R: 'static + Read + Send;
fn async_chunk_slice<R>(
&self,
slice: R,
queue_depth: usize
) -> Receiver<Result<Vec<u8, Global>, ChunkerError>>
where
R: 'static + AsRef<[u8]> + Send;
}
Expand description
Asynchronous version of Chunker
Only available if the streams feature is enabled.
Works by performing the chunking in an async task, falling through to the implementation in
Chunker
, and passing the results over an mspc channel
Required methods
Async version of Chunker::chunk_boxed
Async version of Chunker::chunk