Skip to main content

ExecutableLookup

Struct ExecutableLookup 

Source
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>

Source

pub const fn new(environment: &'env BTreeMap<String, String>) -> Self

Borrow an existing environment without copying or refreshing it.

Source

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.

Source

pub fn find(&self, name: &str) -> Option<PathBuf>

Find the first directly runnable candidate without executing it.

Candidate precedence and executable checks use the current platform’s conventions. A missing PATH or eligible file returns None.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.