pub struct MapResolver {
pub resolved: BTreeMap<String, String>,
pub pins: BTreeMap<String, String>,
}Expand description
In-memory resolver for tests and conformance fixtures.
Fields§
§resolved: BTreeMap<String, String>Program name → path it resolves to on the search path.
pins: BTreeMap<String, String>Program name → path recorded at install time.
Trait Implementations§
Source§impl Clone for MapResolver
impl Clone for MapResolver
Source§impl Debug for MapResolver
impl Debug for MapResolver
Source§impl Default for MapResolver
impl Default for MapResolver
Source§impl ProgramResolver for MapResolver
impl ProgramResolver for MapResolver
Source§fn resolve(&self, program: &str) -> Option<String>
fn resolve(&self, program: &str) -> Option<String>
Absolute path
program would run from, or None if it is not found.Source§fn pinned(&self, program: &str) -> Option<String>
fn pinned(&self, program: &str) -> Option<String>
Path recorded for
program when the kernel was installed, if any.Source§fn own_binaries(&self) -> Vec<String>
fn own_binaries(&self) -> Vec<String>
Where OpenMoat’s own binary and its alias are installed. A command
whose program word reaches one of these files, through a link under
another name or on the search path, is decided as
openmoat too, so
the rules that keep OpenMoat’s person-only commands from an agent see
it. By default the pins of openmoat and moat.Source§fn local_bin(&self, _dirs: &[String], _name: &str) -> bool
fn local_bin(&self, _dirs: &[String], _name: &str) -> bool
Whether a package runner’s word
name names a program the project
installed: node_modules/.bin/<name> in one of dirs (the working
directory, then each parent up to the project root), which npx and
its kind run without fetching anything (ADR-102). Asked only for a word
that names no version and no package option. By default no.Source§fn declared(&self, _dirs: &[String], _ecosystem: Ecosystem, _name: &str) -> bool
fn declared(&self, _dirs: &[String], _ecosystem: Ecosystem, _name: &str) -> bool
Whether the nearest manifest in
dirs declares the package name of
ecosystem (package.json dependencies, pyproject.toml or
uv.lock): the project chose it, so a runner fetching it is no
unknown package (ADR-102). By default no.Auto Trait Implementations§
impl Forget for MapResolver
impl Freeze for MapResolver
impl Move for MapResolver
impl RefUnwindSafe for MapResolver
impl Send for MapResolver
impl Sync for MapResolver
impl Unpin for MapResolver
impl UnsafeUnpin for MapResolver
impl UnwindSafe for MapResolver
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
Mutably borrows from an owned value. Read more