INNER CODE UNIT · Rust

with_mode

orf/gping · pinger/src/lib.rs:118

    pub fn with_mode(mut self, mode: PingMode) -> Self {
        self.mode = mode;
        self
    }
}

pub fn run_ping(
    cmd: impl AsRef<OsStr> + Debug,
    args: Vec<impl AsRef<OsStr> + Debug>,
) -> Result<Child, PingCreationError> {
    Ok(Command::new(cmd.as_ref())
        .args(&args)
        .stdout(Stdio::piped())
        .stderr(Stdio::piped())
        // Required to ensure that the output is formatted in the way we expect, not
        // using locale specific delimiters.
        .env("LANG", "C")
        .env("LC_ALL", "C")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…