weirdnet-rules 0.1.0

Weirdnet rules: if-this-then-that over an event history. Condition syntax and comparison, rule specs generic over the application's then-actions, a matching and loop-protected engine behind a host trait, templates, and every/cron schedules.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/// A rule, condition, pattern or schedule that does not parse.
#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
pub enum RulesError {
    #[error("invalid {what}: {msg}")]
    Invalid { what: &'static str, msg: String },
}

impl RulesError {
    pub fn invalid(what: &'static str, msg: impl Into<String>) -> Self {
        RulesError::Invalid { what, msg: msg.into() }
    }
}

pub type Result<T> = std::result::Result<T, RulesError>;