runcc/run/command/
stopped.rs

1use std::{io, process::ExitStatus};
2
3use super::super::kill;
4
5#[non_exhaustive]
6pub struct CommandStopped<T, R> {
7    pub data: T,
8    pub exit_status: io::Result<ExitStatus>,
9    pub killed: Option<kill::KillJoinHandleFinalStatus<R>>,
10}
11
12impl<T, R> CommandStopped<T, R> {
13    pub fn with_data<S>(self, new_data: S) -> (T, CommandStopped<S, R>) {
14        let Self {
15            data,
16            exit_status,
17            killed,
18        } = self;
19        (
20            data,
21            CommandStopped {
22                data: new_data,
23                exit_status,
24                killed,
25            },
26        )
27    }
28}