pub struct ExecutableLookup<'env> { /* private fields */ }Expand description
Read-only executable lookup against a caller-owned environment snapshot.
Construction borrows the map without reading the process environment.
Lookup applies the native PATH/PATHEXT rules and inspects candidate file
metadata; it never starts a program or creates cache state. The snapshot
does not freeze the filesystem, and a returned path grants no execution
authority to a caller.
Implementations§
Source§impl<'env> ExecutableLookup<'env>
impl<'env> ExecutableLookup<'env>
Sourcepub const fn new(environment: &'env BTreeMap<String, String>) -> Self
pub const fn new(environment: &'env BTreeMap<String, String>) -> Self
Borrow an existing environment without copying or refreshing it.
Sourcepub fn environment_value(&self, name: &str) -> Option<&'env str>
pub fn environment_value(&self, name: &str) -> Option<&'env str>
Read one borrowed value with native environment-name case rules.
Exact spelling wins. Windows additionally accepts ASCII case variants; other platforms retain case-sensitive lookup.
Auto Trait Implementations§
impl<'env> Freeze for ExecutableLookup<'env>
impl<'env> RefUnwindSafe for ExecutableLookup<'env>
impl<'env> Send for ExecutableLookup<'env>
impl<'env> Sync for ExecutableLookup<'env>
impl<'env> Unpin for ExecutableLookup<'env>
impl<'env> UnsafeUnpin for ExecutableLookup<'env>
impl<'env> UnwindSafe for ExecutableLookup<'env>
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