Skip to main content

Module source

Module source 

Source
Expand description

ImageSource — the universal read-only byte edge every layer speaks.

A positioned-read stream: read_at(&self, offset, buf) carries no cursor, so one source is shared across threads by &self. There is deliberately no write method anywhere in this trait — evidence is read-only by construction, not by convention. Send + Sync are supertraits, so DynSource (Arc<dyn ImageSource>) is itself Send + Sync and composes cleanly at every seam.

Structs§

Extent
One allocated extent [offset, offset+len) in a source’s address space.
Extents
The allocated-extent map of a source, so callers skip zero/sparse runs on TB-scale images. A container reader reports real allocated runs; the default is one dense extent covering the whole stream.
SourceId
Stable identity for a source, for cache keying and lineage. Assigned by the engine; a SubRange/decrypted/overlay source records this so a block cache can account by identity rather than by accident of equal offsets.

Enums§

SourceView
A borrowed, contiguous view into a source that owns whatever guard keeps it alive, so a lent slice never dangles over an evicting cache (the round-1 fix against a bare &[u8] tied to &self). Derefs to the bytes.

Traits§

ImageSource
A read-only, randomly-addressable byte stream: a decoded container, a partition window, a decrypted volume, a VSS store, a file’s data, or a byte range of any of them. Send + Sync; positioned reads only; no writer.

Functions§

read_exact_at
Read exactly buf.len() bytes at offset, erroring if the stream is too short — the “give me all of it or fail loud” helper over the short-read ImageSource::read_at.

Type Aliases§

DynSource
The object-safe shared handle used at every composition seam. Arc, not Box: a child layer keeps a handle to its parent, and one parent backs many children (every partition shares the disk source). Send + Sync because ImageSource requires them.