pub struct Invariant {
pub name: String,
pub description: Option<String>,
pub expression: Expression,
pub severity: String,
pub category: String,
pub is_always_true: bool,
pub layers: Vec<String>,
pub phases: Vec<String>,
}Expand description
A compiled invariant expression with metadata.
Fields§
§name: StringUnique identifier for the invariant.
description: Option<String>Human-readable description.
expression: ExpressionThe invariant expression in IR form.
severity: StringSeverity level: “critical”, “high”, “medium”, “low”.
category: StringCategory: “core”, “defi”, “bridge”, “governance”, “account-abstraction”, etc.
is_always_true: boolWhether this invariant should always hold.
layers: Vec<String>Layer scopes for cross-layer analysis (e.g., [“bundler”, “account”, “paymaster”]). If empty, applies to all layers.
phases: Vec<String>Execution phases (e.g., [“validation”, “execution”, “settlement”]). For AA invariants that must hold at specific phases. Empty means all phases.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Invariant
impl<'de> Deserialize<'de> for Invariant
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Invariant
impl RefUnwindSafe for Invariant
impl Send for Invariant
impl Sync for Invariant
impl Unpin for Invariant
impl UnsafeUnpin for Invariant
impl UnwindSafe for Invariant
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more