use crate::report::{FindingCause, ForeignText};
#[path = "type_guard.rs"]
mod guard;
const CAUSE_FAMILY: &str = "macroonz.preemption";
pub const MODEL_BROKE: FindingCause = FindingCause::named(CAUSE_FAMILY, "model-broke");
pub const LOOM_PIN: &str = "0.7.2";
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum PreemptionBound {
Exhaustive,
AtMost(u32),
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct PreemptionBounds {
preemptions: PreemptionBound,
branches: u32,
}
#[must_use = "a refusal is the reason preemption bounds were not built"]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum PreemptionBoundsRefusal {
ZeroBranches,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct PreemptionModelFailure {
report: Option<ForeignText>,
}
pub type PreemptionModelResult = Result<(), PreemptionModelFailure>;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum PreemptionVerdict {
AllInterleavingsHeld,
ModelBroke {
report: Option<ForeignText>,
},
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum IncompleteExploration {
Unavailable,
InitializationFailed {
report: Option<ForeignText>,
},
ExecutionUnresolved {
report: Option<ForeignText>,
},
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum PreemptionOutcome {
Completed(PreemptionVerdict),
Incomplete(IncompleteExploration),
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct PreemptionReading {
bounds: PreemptionBounds,
outcome: PreemptionOutcome,
}