Sigil documentation
ReferenceRust referencesigil-anomaly

sigil-anomaly · loader

Source declarations, signatures and documentation for loader.

Source: sigil/node/sigil-anomaly/src/loader.rs. SHA-256: 648702d2c9987b43ed6ed0af5d6931432c1b95580f64d1cea31d04118bf215ab.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

loader::RuleConfigFile

Top-level rule-config file structure.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct RuleConfigFile {
#[serde(default, rename = "rule")]
pub rules: Vec<RuleConfig>
}

Source line: 68.

loader::RuleConfig

One rule declaration.

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RuleConfig {
pub kind: RuleKind,
/// Stable operator-supplied seed mixed into the BLAKE3 id.

pub id_seed: String,
/// Kind-specific parameters.

pub params: serde_json::Value
}

Source line: 75.

loader::RuleKind

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum RuleKind {
    GasSpike,
    BalanceDrain,
    SlashingBurst,
    LineageDepth,
}

Source line: 85.

loader::RuleKind::as_str

pub fn as_str(&self) -> &'static str;

Source line: 93.

loader::load_rule_set

Load rules from a parsed [RuleConfigFile] and register them in a fresh [RuleSet]. The set is sealed before return.

pub fn load_rule_set(file: &RuleConfigFile) -> Result<RuleSet>;

Source line: 126.

loader::build_rule

Build a single rule from its config entry.

pub fn build_rule(cfg: &RuleConfig) -> Result<Arc<dyn AnomalyRule>>;

Source line: 146.

On this page