Skip to main content

Invariants

Trait Invariants 

Source
pub trait Invariants {
    type Spec: Spec;
    type Violation: Serialize + DeserializeOwned + Clone;

    // Required method
    fn check(spec: &Self::Spec) -> Vec<Self::Violation>;
}
Expand description

The typed shape of an adapter’s invariants pass. Every adapter ships a check(spec) -> Vec<Violation> function that verifies the spec is well-formed against its own typed rules.

gen confirm invokes this per-adapter. cse-lint can invoke it fleet-wide.

Required Associated Types§

Source

type Spec: Spec

The adapter’s spec type — pinned to the same Spec impl as the adapter’s build() returns.

Source

type Violation: Serialize + DeserializeOwned + Clone

The adapter’s typed violation enum. Always serializable so gen confirm / cse-lint / IDE tooling can consume the payload uniformly.

Required Methods§

Source

fn check(spec: &Self::Spec) -> Vec<Self::Violation>

Run every invariant against the spec. Returns the violation list (empty when the spec is valid). Pure function, no I/O, deterministic output.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§