pub trait ArchiveBytes {
// Required method
fn at(&self, at: u64, len: u64) -> Result<Cow<'_, [u8]>>;
}Expand description
Bytes of the verbatim archive, addressed absolutely.
The mmap ([crate::archive_map]) answers without a syscall and without a
copy; a pread answers the tail a snapshot does not cover. Both are the
same bytes, which is why the chain walker below can take either and never
know which it got.
It exists so materialize_at can live here — beside the delta code it
reuses — without this module learning what a store is.
Required Methods§
Sourcefn at(&self, at: u64, len: u64) -> Result<Cow<'_, [u8]>>
fn at(&self, at: u64, len: u64) -> Result<Cow<'_, [u8]>>
Up to len bytes at at. Short is not an error: a probe near the
end of the archive legitimately gets fewer, and the parsers below read a
grammar rather than a fixed width. Empty means “there is nothing there”,
which every caller treats as a corrupt back-reference.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".