INNER CODE UNIT · Rust

with_exit_code

psmux/psmux · crates/portable-pty-psmux/src/lib.rs:199

    pub fn with_exit_code(code: u32) -> Self {
        Self { code, signal: None }
    }

    /// Construct an ExitStatus from a signal name
    pub fn with_signal(signal: &str) -> Self {
        Self {
            code: 1,
            signal: Some(signal.to_string()),
        }
    }

    /// Returns true if the status indicates successful completion
    pub fn success(&self) -> bool {
        match self.signal {
            None => self.code == 0,
            Some(_) => false,
        }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…