Skip to main content

open_threaded

Function open_threaded 

Source
pub fn open_threaded<R, O, M>(
    open: O,
    map_error: M,
) -> ContentFuture<'static, Result<ContentReaderRef, ContentError>>
where R: Read, O: FnOnce() -> Result<R, ContentError> + Send + 'static, M: Fn(Error) -> ContentError + Send + 'static,
Expand description

Opens a source with open on a thread of its own and reads it there, DEFAULT_CHUNK_LEN bytes at a time and at most MAX_PENDING_CHUNKS chunks ahead of the reader. The future resolves once the source is open; map_error describes a read that fails later.