PayloadSource

Trait PayloadSource 

pub trait PayloadSource:
    Read
    + Seek
    + Send {
    // Required methods
    fn total_size(&self) -> u64;
    fn extents(&self) -> &[Extent];

    // Provided methods
    fn bind_snapshot(&mut self, snapshot: &SourceSnapshot) -> Result<(), Error> { ... }
    fn is_sparse(&self) -> bool { ... }
    fn opened_with_noatime(&self) -> bool { ... }
    fn finish(&mut self) -> Result<Vec<String>, Error> { ... }
}
Expand description

Abstract streaming provider for file payload data and extents.

Required Methods§

fn total_size(&self) -> u64

Total logical byte size of the payload.

fn extents(&self) -> &[Extent]

Discovered sparse extents.

Provided Methods§

fn bind_snapshot(&mut self, snapshot: &SourceSnapshot) -> Result<(), Error>

Binds this reader to the physical state observed before metadata capture.

fn is_sparse(&self) -> bool

Whether any holes exist in the payload.

fn opened_with_noatime(&self) -> bool

Whether this payload source was opened without modifying access time (e.g. via O_NOATIME on Linux or in-memory cursor).

fn finish(&mut self) -> Result<Vec<String>, Error>

Completes reading before discarding the source. Returns fidelity warnings for retention in semantic metadata; source changes are errors. Callers must surface and retain warnings, or reject them in strict mode.

Trait Implementations§

Source§

impl DetectionSource for dyn PayloadSource + '_

Source§

fn read_at(&mut self, offset: u64, buf: &mut [u8]) -> Result<usize>

Reads up to buf.len() bytes at the specified offset.
Source§

fn total_len(&self) -> Option<u64>

Total logical length of payload in bytes if known.
Source§

fn read_bof(&mut self, max_len: usize) -> Result<Vec<u8>>

Reads up to max_len bytes from the beginning of the file (BOF).
Source§

fn read_eof(&mut self, max_len: usize) -> Result<Vec<u8>>

Reads up to max_len bytes backwards from the end of the file (EOF).

Implementations on Foreign Types§

§

impl<P> PayloadSource for ProgressStream<P>
where P: PayloadSource,

§

fn total_size(&self) -> u64

§

fn extents(&self) -> &[Extent]

§

fn is_sparse(&self) -> bool

§

fn opened_with_noatime(&self) -> bool

§

fn finish(&mut self) -> Result<Vec<String>, Error>

Implementors§