pub enum Cmd {
Cd {
cmd: Command,
stderr: StderrTarget,
},
Echo {
cmd: Command,
stdout: StdoutTarget,
stderr: StderrTarget,
},
Exit(u8),
Type {
cmd: Command,
stdout: StdoutTarget,
stderr: StderrTarget,
},
Exec {
cmd: Command,
stdout: StdoutTarget,
stderr: StderrTarget,
},
Pwd {
stdout: StdoutTarget,
stderr: StderrTarget,
},
History {
cmd: Command,
stdout: StdoutTarget,
stderr: StderrTarget,
},
Unknown {
cmd: Command,
stderr: StderrTarget,
},
}Variants§
Implementations§
Source§impl Cmd
impl Cmd
Sourcepub const fn is_history(&self) -> bool
pub const fn is_history(&self) -> bool
Returns true if the enum is Cmd::History otherwise false
Sourcepub const fn is_unknown(&self) -> bool
pub const fn is_unknown(&self) -> bool
Returns true if the enum is Cmd::Unknown otherwise false
Source§impl Cmd
impl Cmd
pub fn try_as_exit(self) -> Option<u8>
pub const fn try_as_exit_ref(&self) -> Option<&u8>
pub fn try_as_exit_mut(&mut self) -> Option<&mut u8>
Source§impl Cmd
impl Cmd
pub fn from_input(raw: &str) -> Result<Option<Self>>
pub fn from_parts( cmd_name: &str, args: Vec<String>, stdout: StdoutTarget, stderr: StderrTarget, ) -> Self
Sourcepub fn run_with_status(
&self,
shell_name: &str,
history: &[String],
) -> Result<(RunResult, u8)>
pub fn run_with_status( &self, shell_name: &str, history: &[String], ) -> Result<(RunResult, u8)>
Run the command and return (RunResult, exit_status). Exit status is used for && / ||.
pub fn run(&self, shell_name: &str, history: &[String]) -> Result<RunResult>
Trait Implementations§
impl StructuralPartialEq for Cmd
Auto Trait Implementations§
impl Freeze for Cmd
impl RefUnwindSafe for Cmd
impl Send for Cmd
impl Sync for Cmd
impl Unpin for Cmd
impl UnsafeUnpin for Cmd
impl UnwindSafe for Cmd
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