vyre 0.3.0

GPU bytecode condition engine
Documentation
/// Maximum supported strings per rule in the GPU layout.
pub const MAX_RULE_STRINGS: usize = 256;
/// Maximum cached positions per string for positional checks.
pub const MAX_CACHED_POSITIONS: usize = 256;

/// Pattern entry used to build `warpstate::PatternSet`.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct CompiledPattern {
    /// Global pattern id.
    pub pattern_id: u32,
    /// Owning rule id.
    pub rule_id: u32,
    /// Rule-local string id.
    pub string_id: u32,
    /// Pattern identifier, for example `$a`.
    pub identifier: String,
    /// Concrete bytes or regex text passed to the matcher.
    pub source: String,
    /// Whether this entry is regex-backed.
    pub is_regex: bool,
}

/// Single materialized rule match result.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RuleMatch {
    /// Rule name.
    pub rule_name: String,
    /// Rule tags.
    pub tags: Vec<String>,
}

/// Minimal rule metadata stored in the compiled index.
#[derive(Debug, Clone)]
pub struct RuleEntry {
    /// Rule name.
    pub name: String,
    /// Rule tags.
    pub tags: Vec<String>,
    /// String identifiers for this rule.
    pub strings: Vec<String>,
}