[][src]Trait asuran::chunker::AsyncChunker

pub trait AsyncChunker: Chunker + Send + Sync {
    fn async_chunk_boxed(
        &self,
        read: Box<dyn Read + 'static + Send>
    ) -> Receiver<Result<Vec<u8>, ChunkerError>>;
fn async_chunk<R>(&self, read: R) -> Receiver<Result<Vec<u8>, ChunkerError>>
    where
        R: 'static + Read + Send
;
fn async_chunk_slice<R>(
        &self,
        slice: R
    ) -> Receiver<Result<Vec<u8>, ChunkerError>>
    where
        R: 'static + AsRef<[u8]> + Send
; }

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

fn async_chunk_boxed(
    &self,
    read: Box<dyn Read + 'static + Send>
) -> Receiver<Result<Vec<u8>, ChunkerError>>

Async version of Chunker::chunk_boxed

fn async_chunk<R>(&self, read: R) -> Receiver<Result<Vec<u8>, ChunkerError>> where
    R: 'static + Read + Send

Async version of Chunker::chunk

fn async_chunk_slice<R>(
    &self,
    slice: R
) -> Receiver<Result<Vec<u8>, ChunkerError>> where
    R: 'static + AsRef<[u8]> + Send

Async version of Chunker::chunk_slice

Loading content...

Implementors

impl<T> AsyncChunker for T where
    T: Chunker + Send + Sync,
    <T as Chunker>::Chunks: Send
[src]

Loading content...