pub struct ShellState { /* private fields */ }
Implementations§
Source§impl ShellState
impl ShellState
pub fn new( env_vars: HashMap<OsString, OsString>, cwd: PathBuf, custom_commands: HashMap<String, Rc<dyn ShellCommand>>, kill_signal: KillSignal, ) -> Self
pub fn cwd(&self) -> &PathBuf
pub fn env_vars(&self) -> &HashMap<OsString, OsString>
pub fn get_var(&self, name: &OsStr) -> Option<&OsString>
pub fn set_cwd(&mut self, cwd: PathBuf)
pub fn apply_changes(&mut self, changes: &[EnvChange])
pub fn apply_change(&mut self, change: &EnvChange)
pub fn apply_env_var(&mut self, name: &OsStr, value: &OsStr)
pub fn kill_signal(&self) -> &KillSignal
pub fn track_child_process(&self, child: &Child)
Sourcepub fn resolve_custom_command(
&self,
name: &OsStr,
) -> Option<Rc<dyn ShellCommand>>
pub fn resolve_custom_command( &self, name: &OsStr, ) -> Option<Rc<dyn ShellCommand>>
Resolves a custom command that was injected.
Sourcepub fn resolve_command_path(
&self,
command_name: &OsStr,
) -> Result<PathBuf, CommandPathResolutionError>
pub fn resolve_command_path( &self, command_name: &OsStr, ) -> Result<PathBuf, CommandPathResolutionError>
Resolves the path to a command from the current working directory.
Does not take injected custom commands into account.
pub fn with_child_signal(&self) -> ShellState
Trait Implementations§
Source§impl Clone for ShellState
impl Clone for ShellState
Source§fn clone(&self) -> ShellState
fn clone(&self) -> ShellState
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreimpl BaseEnvVar for ShellState
Auto Trait Implementations§
impl Freeze for ShellState
impl !RefUnwindSafe for ShellState
impl !Send for ShellState
impl !Sync for ShellState
impl Unpin for ShellState
impl !UnwindSafe for ShellState
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