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 duplicate 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 moreSource§impl Sys for ShellState
impl Sys for ShellState
type ReadDirEntry = DirEntry
type Metadata = Metadata
Source§fn is_windows(&self) -> bool
fn is_windows(&self) -> bool
Check if the current platform is Windows. Read more
Source§fn current_dir(&self) -> Result<PathBuf>
fn current_dir(&self) -> Result<PathBuf>
Gets the current working directory.
Source§fn env_split_paths(&self, paths: &OsStr) -> Vec<PathBuf>
fn env_split_paths(&self, paths: &OsStr) -> Vec<PathBuf>
Splits a platform-specific PATH variable into a list of paths.
Source§fn env_path_ext(&self) -> Option<OsString>
fn env_path_ext(&self) -> Option<OsString>
Gets the value of the PATHEXT environment variable. If not on Windows, simply return None.
Source§fn env_windows_path_ext(&self) -> Cow<'static, [String]>
fn env_windows_path_ext(&self) -> Cow<'static, [String]>
Gets and parses the PATHEXT environment variable on Windows. Read more
Source§fn metadata(&self, path: &Path) -> Result<Self::Metadata>
fn metadata(&self, path: &Path) -> Result<Self::Metadata>
Gets the metadata of the provided path, following symlinks.
Source§fn symlink_metadata(&self, path: &Path) -> Result<Self::Metadata>
fn symlink_metadata(&self, path: &Path) -> Result<Self::Metadata>
Gets the metadata of the provided path, not following symlinks.
impl 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