pub struct RegistryArchiveTree<'a> { /* private fields */ }Expand description
Immutable package files from one checksum-authenticated registry archive.
This constructor consumes supplied bytes only: it never finds a cache, fetches,
extracts files or executes inspected code. Both compressed and decompressed
archive bytes are capped by max_total_bytes. Native gzip decoding and the
strict tar inventory run under RAF’s item and work grants. RAF’s
retained file payloads, listing and subsequent source operations are metered.
Authentication establishes equality to the lock checksum, not trusted authorship.
Implementations§
Source§impl<'a> RegistryArchiveTree<'a>
impl<'a> RegistryArchiveTree<'a>
Sourcepub fn from_bytes(
catalog: &'a LockedCatalog,
package: LockedPackageId,
archive: &[u8],
options: &LoadOptions,
) -> Result<Self, LoadError>
pub fn from_bytes( catalog: &'a LockedCatalog, package: LockedPackageId, archive: &[u8], options: &LoadOptions, ) -> Result<Self, LoadError>
Authenticate and load the .crate bytes for an exact registry lock row.
The native tar interpretation supplies paths and file bodies. RAF requires
canonical paths under exactly name-version/, regular files/directories,
a root Cargo manifest and an unambiguous file/directory inventory. Contents
remain binary until a source read requires UTF-8.
§Errors
Refuses missing checksums, nonregistry rows, checksum mismatch, exhausted byte/storage/work grants, nested transport, native errors or diagnostics, links, special files and invalid package inventories. Original native causes remain available through the error chain.
Sourcepub fn source(&self) -> &LockedSource
pub fn source(&self) -> &LockedSource
The registry identity whose archive checksum authenticated these contents.
Trait Implementations§
Source§impl Tree for RegistryArchiveTree<'_>
impl Tree for RegistryArchiveTree<'_>
Source§fn read(&self, path: &RelPath, max_bytes: u64) -> Result<String, TreeError>
fn read(&self, path: &RelPath, max_bytes: u64) -> Result<String, TreeError>
path. Read moreSource§fn read_unseen(
&self,
path: &RelPath,
max_bytes: u64,
seen: &dyn Fn(&FileId) -> bool,
) -> Result<Opened, TreeError>
fn read_unseen( &self, path: &RelPath, max_bytes: u64, seen: &dyn Fn(&FileId) -> bool, ) -> Result<Opened, TreeError>
path once, take its identity from that open, and
read its text from the same open unless seen says the identity is
one the caller already holds. Read moreSource§fn list(&self, path: &RelPath) -> Result<Vec<Entry>, TreeError>
fn list(&self, path: &RelPath) -> Result<Vec<Entry>, TreeError>
path, sorted by name. Read moreAuto Trait Implementations§
impl<'a> !Freeze for RegistryArchiveTree<'a>
impl<'a> !RefUnwindSafe for RegistryArchiveTree<'a>
impl<'a> !Send for RegistryArchiveTree<'a>
impl<'a> !Sync for RegistryArchiveTree<'a>
impl<'a> !UnwindSafe for RegistryArchiveTree<'a>
impl<'a> Forget for RegistryArchiveTree<'a>
impl<'a> Move for RegistryArchiveTree<'a>
impl<'a> Unpin for RegistryArchiveTree<'a>
impl<'a> UnsafeUnpin for RegistryArchiveTree<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more