pub struct Preview { /* private fields */ }Expand description
An in-memory capability with fixed arguments and no arbitrary environment/command API. Constructing/describing it does not discover paths, read files or start a process.
Implementations§
Source§impl Preview
impl Preview
Sourcepub fn new(
query: Query,
executable: PathBuf,
home: PathBuf,
trusted_search_path: Vec<PathBuf>,
) -> Result<Self, Failure>
pub fn new( query: Query, executable: PathBuf, home: PathBuf, trusted_search_path: Vec<PathBuf>, ) -> Result<Self, Failure>
All paths are explicit application-boundary trust decisions, never manifest strings. The query runs at /, not in a repository. The caller must not probe PATH candidates to decide whether they are trustworthy. No trust is persisted here.
Sourcepub fn npm_inventory(
executable: PathBuf,
home: PathBuf,
trusted_search_path: Vec<PathBuf>,
) -> Result<Self, Failure>
pub fn npm_inventory( executable: PathBuf, home: PathBuf, trusted_search_path: Vec<PathBuf>, ) -> Result<Self, Failure>
Standalone inventory through a trusted npm program from the application PATH. Approval covers prefix discovery and a global list scoped to that reported prefix. It grants no declared-runtime or installation authority.
Sourcepub fn npm(
manifest: &Manifest,
binding: NpmBinding,
home: PathBuf,
trusted_search_path: Vec<PathBuf>,
) -> Result<Self, Failure>
pub fn npm( manifest: &Manifest, binding: NpmBinding, home: PathBuf, trusted_search_path: Vec<PathBuf>, ) -> Result<Self, Failure>
The binding must name a runtime declared in this manifest. No version, executable identity or installed-runtime association is inferred from it.