Trait cross::CommandExt

source ·
pub trait CommandExt {
    fn fmt_message(&self, msg_info: &mut MessageInfo) -> String;
    fn status_result(
        &self,
        msg_info: &mut MessageInfo,
        status: ExitStatus,
        output: Option<&Output>
    ) -> Result<(), CommandError>; fn run(
        &mut self,
        msg_info: &mut MessageInfo,
        silence_stdout: bool
    ) -> Result<()>; fn run_and_get_status(
        &mut self,
        msg_info: &mut MessageInfo,
        silence_stdout: bool
    ) -> Result<ExitStatus>; fn run_and_get_stdout(
        &mut self,
        msg_info: &mut MessageInfo
    ) -> Result<String>; fn run_and_get_output(
        &mut self,
        msg_info: &mut MessageInfo
    ) -> Result<Output>; fn command_pretty(
        &self,
        msg_info: &mut MessageInfo,
        strip: impl for<'a> Fn(&'a str) -> bool
    ) -> String; fn print(&self, msg_info: &mut MessageInfo) -> Result<()> { ... } fn info(&self, msg_info: &mut MessageInfo) -> Result<()> { ... } fn debug(&self, msg_info: &mut MessageInfo) -> Result<()> { ... } }

Required Methods§

source

fn fmt_message(&self, msg_info: &mut MessageInfo) -> String

source

fn status_result(
    &self,
    msg_info: &mut MessageInfo,
    status: ExitStatus,
    output: Option<&Output>
) -> Result<(), CommandError>

source

fn run(&mut self, msg_info: &mut MessageInfo, silence_stdout: bool) -> Result<()>

source

fn run_and_get_status(
    &mut self,
    msg_info: &mut MessageInfo,
    silence_stdout: bool
) -> Result<ExitStatus>

source

fn run_and_get_stdout(&mut self, msg_info: &mut MessageInfo) -> Result<String>

source

fn run_and_get_output(&mut self, msg_info: &mut MessageInfo) -> Result<Output>

source

fn command_pretty(
    &self,
    msg_info: &mut MessageInfo,
    strip: impl for<'a> Fn(&'a str) -> bool
) -> String

Provided Methods§

source

fn print(&self, msg_info: &mut MessageInfo) -> Result<()>

source

fn info(&self, msg_info: &mut MessageInfo) -> Result<()>

source

fn debug(&self, msg_info: &mut MessageInfo) -> Result<()>

Implementations on Foreign Types§

source§

impl CommandExt for Command

source§

fn run(&mut self, msg_info: &mut MessageInfo, silence_stdout: bool) -> Result<()>

Runs the command to completion

source§

fn run_and_get_status(
    &mut self,
    msg_info: &mut MessageInfo,
    silence_stdout: bool
) -> Result<ExitStatus>

Runs the command to completion

source§

fn run_and_get_stdout(&mut self, msg_info: &mut MessageInfo) -> Result<String>

Runs the command to completion and returns its stdout

source§

fn run_and_get_output(&mut self, msg_info: &mut MessageInfo) -> Result<Output>

Runs the command to completion and returns the status and its output.

Notes

This command does not check the status.

source§

fn command_pretty(
    &self,
    msg_info: &mut MessageInfo,
    strip: impl for<'a> Fn(&'a str) -> bool
) -> String

source§

fn fmt_message(&self, msg_info: &mut MessageInfo) -> String

source§

fn status_result(
    &self,
    msg_info: &mut MessageInfo,
    status: ExitStatus,
    output: Option<&Output>
) -> Result<(), CommandError>

Implementors§