pub struct CwdEnvironment<'a> { /* private fields */ }Expand description
An Environment whose current directory is cwd (everything else is
delegated).
Implementations§
Source§impl<'a> CwdEnvironment<'a>
impl<'a> CwdEnvironment<'a>
Sourcepub const fn new(inner: &'a dyn Environment, cwd: PathBuf) -> Self
pub const fn new(inner: &'a dyn Environment, cwd: PathBuf) -> Self
inner, as seen from cwd.
Trait Implementations§
Source§impl Environment for CwdEnvironment<'_>
impl Environment for CwdEnvironment<'_>
Source§fn path_exists(&self, path: &Path) -> bool
fn path_exists(&self, path: &Path) -> bool
Check if a path exists (file or directory).
Source§fn run_command(
&self,
cmd: &str,
args: &[&str],
timeout_ms: u64,
) -> Option<String>
fn run_command( &self, cmd: &str, args: &[&str], timeout_ms: u64, ) -> Option<String>
Run a command and return its stdout, or
None on failure/timeout.Source§fn run_command_outcome(
&self,
cmd: &str,
args: &[&str],
timeout_ms: u64,
) -> CommandOutcome
fn run_command_outcome( &self, cmd: &str, args: &[&str], timeout_ms: u64, ) -> CommandOutcome
Run a command and report why it produced no output. Read more
Source§fn run_command_partial(
&self,
cmd: &str,
args: &[&str],
timeout_ms: u64,
) -> (CommandOutcome, Option<String>)
fn run_command_partial( &self, cmd: &str, args: &[&str], timeout_ms: u64, ) -> (CommandOutcome, Option<String>)
Like
Self::run_command_outcome, but a command that timed out also
returns what it printed before it was stopped (when known), so a
file count can say “more than N files” instead of nothing. The
default reports no partial output.Auto Trait Implementations§
impl<'a> !RefUnwindSafe for CwdEnvironment<'a>
impl<'a> !UnwindSafe for CwdEnvironment<'a>
impl<'a> Forget for CwdEnvironment<'a>
impl<'a> Freeze for CwdEnvironment<'a>
impl<'a> Move for CwdEnvironment<'a>
impl<'a> Send for CwdEnvironment<'a>
impl<'a> Sync for CwdEnvironment<'a>
impl<'a> Unpin for CwdEnvironment<'a>
impl<'a> UnsafeUnpin for CwdEnvironment<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more