pub struct SystemPresence;Expand description
The process’s own PATH and environment: an executable counts when a file of its
name with an execute bit stands in a PATH directory, a variable when it is set and
non-empty. A name containing / is never an executable on PATH.
use majordomus_cli::reasoning::availability::{Presence, SystemPresence};
std::env::set_var("MAJORDOMUS_DOCTEST_PRESENCE", "set");
assert!(SystemPresence.variable("MAJORDOMUS_DOCTEST_PRESENCE"));
std::env::set_var("MAJORDOMUS_DOCTEST_PRESENCE", "");
assert!(!SystemPresence.variable("MAJORDOMUS_DOCTEST_PRESENCE"));
assert!(!SystemPresence.executable("bin/a-path-is-not-a-name"));Trait Implementations§
Source§impl Clone for SystemPresence
impl Clone for SystemPresence
Source§fn clone(&self) -> SystemPresence
fn clone(&self) -> SystemPresence
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SystemPresence
Source§impl Debug for SystemPresence
impl Debug for SystemPresence
Source§impl Default for SystemPresence
impl Default for SystemPresence
Source§fn default() -> SystemPresence
fn default() -> SystemPresence
Returns the “default value” for a type. Read more
Source§impl Presence for SystemPresence
impl Presence for SystemPresence
Auto Trait Implementations§
impl Freeze for SystemPresence
impl RefUnwindSafe for SystemPresence
impl Send for SystemPresence
impl Sync for SystemPresence
impl Unpin for SystemPresence
impl UnsafeUnpin for SystemPresence
impl UnwindSafe for SystemPresence
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