Skip to main content

Source

Trait Source 

Source
pub trait Source: Read {
    // Required methods
    fn caps(&self) -> SourceCaps;
    fn as_seek(&mut self) -> Option<&mut dyn SeekRead>;
}
Expand description

An input stream that reports its own capabilities.

Not Send (since 0.23.0). A decoder must be able to sit over an archive member’s reader, which borrows the archive and is !Send (see crate::Entry); nothing in the tree moves a Source across threads. A site that does need to asks for Box<dyn Source + Send> locally.

Required Methods§

Source

fn caps(&self) -> SourceCaps

Source

fn as_seek(&mut self) -> Option<&mut dyn SeekRead>

Returns a seekable view, or None if this source cannot seek.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§