Struct PackageDirectory
pub struct PackageDirectory { /* private fields */ }Description
One explicit author source root retained as a directory capability.
Package admission reads only package.json and its normalized inventory.
Local-project discovery is a separate explicit method. Neither operation
performs another ambient lookup or follows a symbolic link below the root.
Implementations§
§impl PackageDirectory
impl PackageDirectory
pub fn try_from_dir(
root: Dir,
) -> Result<PackageDirectory, PackageDirectoryError>
pub fn try_from_dir( root: Dir, ) -> Result<PackageDirectory, PackageDirectoryError>
Retain a caller-opened directory capability without acquiring ambient filesystem authority.
§Errors
Returns a path-aware error when the supplied handle does not identify a directory.
pub fn open_ambient(
root: impl Into<PathBuf>,
) -> Result<PackageDirectory, PackageDirectoryError>
pub fn open_ambient( root: impl Into<PathBuf>, ) -> Result<PackageDirectory, PackageDirectoryError>
Open and retain one explicit author source root with ambient authority.
The caller-selected path, including any ancestor resolution, is the one ambient lookup. Its final component is opened without following a symbolic link. Subsequent reads remain handle-relative to this retained directory.
§Errors
Returns a path-aware I/O or file-kind error when the root cannot be opened as a non-symlink directory.
pub fn read_sources(&self) -> Result<PackageSourcesV1, PackageDirectoryError>
pub fn read_sources(&self) -> Result<PackageSourcesV1, PackageDirectoryError>
Read the closed manifest and exactly its inventoried files.
Each path component is opened relative to the preceding retained directory handle without following symbolic links. File metadata is checked before allocation and the read itself is capped to detect concurrent growth beyond its budget. The returned source identity binds the bytes actually read; this operation is not an atomic snapshot of all files and does not prevent concurrent in-place mutation.
§Errors
Returns a path-aware I/O, file-kind, resource, manifest, inventory, or UTF-8 contract error. No partial author input is returned.
pub fn discover_project_sources(
&self,
) -> Result<BTreeMap<NormalizedRelativePath, String>, PackageDirectoryError>
pub fn discover_project_sources( &self, ) -> Result<BTreeMap<NormalizedRelativePath, String>, PackageDirectoryError>
Discover a bounded, deterministic inventory of local .eqi sources.
Symbolic links and non-portable names fail closed, regular non-.eqi
files are ignored, and every nested directory is opened relative to the
retained capability without following links. Discovery admits at most
100,000 entries, 64 nested components, 10,000 sources, 16 MiB per
source, and 256 MiB in aggregate.
§Errors
Returns a path-aware I/O, file-kind, portability, UTF-8, allocation, or resource-limit error. No partial inventory is returned.
pub fn discover_resolved_arrays(
&self,
) -> Result<BTreeMap<NormalizedRelativePath, Vec<u8>>, PackageDirectoryError>
pub fn discover_resolved_arrays( &self, ) -> Result<BTreeMap<NormalizedRelativePath, Vec<u8>>, PackageDirectoryError>
Discover exact JSON array files under an already retained data/ capability.
Uses the same no-follow path, depth, count and byte bounds as source discovery.
§Errors
Returns the existing path-aware directory or resource diagnostic.
pub fn discover_documentation_assets(
&self,
) -> Result<BTreeMap<NormalizedRelativePath, Vec<u8>>, PackageDirectoryError>
pub fn discover_documentation_assets( &self, ) -> Result<BTreeMap<NormalizedRelativePath, Vec<u8>>, PackageDirectoryError>
Discover Markdown attribution payloads under an already retained docs/ capability.
Uses the existing bounded no-follow source directory traversal.
§Errors
Returns the existing path-aware directory or resource diagnostic.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PackageDirectory
impl RefUnwindSafe for PackageDirectory
impl Send for PackageDirectory
impl Sync for PackageDirectory
impl Unpin for PackageDirectory
impl UnsafeUnpin for PackageDirectory
impl UnwindSafe for PackageDirectory
Blanket Implementations§
Source§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Source§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
§fn approx(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
§impl<T> ConvUtil for T
impl<T> ConvUtil for T
§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
§fn into_as<Dst>(self) -> Dstwhere
Self: Sized + Into<Dst>,
fn into_as<Dst>(self) -> Dstwhere
Self: Sized + Into<Dst>,
§fn try_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + TryInto<Dst>,
fn try_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + TryInto<Dst>,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
Source§impl<T> From<T> for T
impl<T> From<T> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<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>where
F: FnOnce(&Self) -> bool,
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
F: FnOnce(&Self) -> bool,
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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Same for T
impl<T> Same for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.