pub enum Outcome {
Cancelled,
Exited(ExitStatus),
Incomplete,
}Expand description
The way in which the run of an external program ended
Every run that starts also ends, and a consumer that shows a running program needs to know how. The variants separate the three ends that a consumer treats differently: the program ran to its end, cancellation stopped it, or Clawless could not collect a result for it.
A program that ended without success is Exited, not a failure. The check
mode of a formatter ends with a non-zero code when it finds a file to
format, and that is an answer and not a fault.
§Examples
use clawless_core::event::process::Outcome;
assert_eq!(Outcome::Cancelled.to_string(), "was cancelled before it ended");Variants§
Cancelled
Cancellation stopped the program before it ended
Clawless killed the program, so it has no exit status. The output that reached the consumer before this point is everything the program wrote.
Exited(ExitStatus)
The program ran to its end
The status says how it ended. A program that a signal stopped carries no
exit code, which ExitStatus::code reports as None.
Incomplete
The run started and produced no result
A stream of the program could not be read, the end of the program could not be waited for, or the events of the run could no longer be reported. The program itself may well have done its work.
Trait Implementations§
Source§impl Display for Outcome
States how the run ended, as the end of a sentence about the command
impl Display for Outcome
States how the run ended, as the end of a sentence about the command
The text follows the command in ProcessEvent, which is why it starts
with a verb and not with a subject.