pub struct SourceTrees<'a> { /* private fields */ }Expand description
A first-party tree and borrowed, independently rooted dependency trees.
This provides physical source separation, not package or revision proof. The caller guarantees each supplied tree’s source identity; a locked catalog must validate that correspondence before publishing grounded dependencies. Authority handles are local to this collection. Relative spelling, module traversal and filesystem containment remain within the selected tree. Each supplied backend accepts unqualified paths and returns authority-zero file identities. Already-scoped backend identities are refused, never flattened.
Implementations§
Source§impl<'a> SourceTrees<'a>
impl<'a> SourceTrees<'a>
Sourcepub const fn new(
first_party: &'a dyn Tree,
dependencies: &'a [&'a dyn Tree],
) -> Self
pub const fn new( first_party: &'a dyn Tree, dependencies: &'a [&'a dyn Tree], ) -> Self
Borrow source trees without copying or retaining their contents.
The load-local authorities, starting with the first-party tree.
Sourcepub fn root(&self, authority: SourceAuthorityId) -> Option<RelPath>
pub fn root(&self, authority: SourceAuthorityId) -> Option<RelPath>
The root of an available source, or None for an unknown authority.
Trait Implementations§
Source§impl Tree for SourceTrees<'_>
impl Tree for SourceTrees<'_>
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_bytes(
&self,
path: &RelPath,
max_bytes: u64,
) -> Result<Vec<u8>, TreeError>
fn read_bytes( &self, path: &RelPath, max_bytes: u64, ) -> Result<Vec<u8>, TreeError>
path, with no UTF-8 check, read
through the same verified handle as Tree::read. 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> !RefUnwindSafe for SourceTrees<'a>
impl<'a> !Send for SourceTrees<'a>
impl<'a> !Sync for SourceTrees<'a>
impl<'a> !UnwindSafe for SourceTrees<'a>
impl<'a> Forget for SourceTrees<'a>
impl<'a> Freeze for SourceTrees<'a>
impl<'a> Move for SourceTrees<'a>
impl<'a> Unpin for SourceTrees<'a>
impl<'a> UnsafeUnpin for SourceTrees<'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