hooked/hooked-config/source/config/exit_action.rs

20 lines
427 B
Rust
Raw Normal View History

2022-10-28 11:35:34 +00:00
//! Action to take on hook exit.
use serde::{Deserialize, Serialize};
/// Action to take on hook exit.
#[derive(Debug, Deserialize, Eq, PartialEq, Serialize)]
2022-10-28 12:37:42 +00:00
#[serde(rename_all = "snake_case")]
2022-10-28 11:35:34 +00:00
pub enum ExitAction {
2024-01-17 17:32:11 +00:00
/// Regardless of the hook's exit code, allow Hooked to continue.
2022-10-28 11:35:34 +00:00
Continue,
2024-01-17 17:32:11 +00:00
/// Stop on a non-zero hook exit code.
2022-10-28 11:35:34 +00:00
Stop,
}
2022-10-28 12:03:32 +00:00
impl Default for ExitAction {
fn default() -> Self {
Self::Stop
}
}