Struct deno_task_shell::ShellState
source · pub struct ShellState { /* private fields */ }
Implementations§
source§impl ShellState
impl ShellState
pub fn new( env_vars: HashMap<String, String>, cwd: &Path, custom_commands: HashMap<String, Rc<dyn ShellCommand>>, ) -> Self
pub fn cwd(&self) -> &PathBuf
pub fn env_vars(&self) -> &HashMap<String, String>
pub fn get_var(&self, name: &str) -> Option<&String>
pub fn set_cwd(&mut self, cwd: &Path)
pub fn apply_changes(&mut self, changes: &[EnvChange])
pub fn apply_change(&mut self, change: &EnvChange)
pub fn apply_env_var(&mut self, name: &str, value: &str)
pub fn token(&self) -> &CancellationToken
sourcepub fn resolve_custom_command(&self, name: &str) -> Option<Rc<dyn ShellCommand>>
pub fn resolve_custom_command(&self, name: &str) -> Option<Rc<dyn ShellCommand>>
Resolves a custom command that was injected.
sourcepub fn resolve_command_path(
&self,
command_name: &str,
) -> Result<PathBuf, ResolveCommandPathError>
pub fn resolve_command_path( &self, command_name: &str, ) -> Result<PathBuf, ResolveCommandPathError>
Resolves the path to a command from the current working directory.
Does not take injected custom commands into account.
pub fn with_child_token(&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 moreAuto 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