Struct boreal_parser::Rule
source · pub struct Rule {
pub name: String,
pub name_span: Range<usize>,
pub tags: Vec<RuleTag>,
pub metadatas: Vec<Metadata>,
pub variables: Vec<VariableDeclaration>,
pub condition: Expression,
pub is_private: bool,
pub is_global: bool,
}Expand description
A Yara rule.
Fields§
§name: StringName of the rule.
name_span: Range<usize>Span for the rule name.
Tags associated with the rule.
metadatas: Vec<Metadata>Metadata associated with the rule.
variables: Vec<VariableDeclaration>Variables associated with the rule.
In Yara terms, those are “strings” (and they are declared with the “strings:” declaration in a rule). However, the “string” denomination is exceedingly confusing in the implementation. Instead, name those “variables”, as they are declared with a prefix ‘$’, which in multiple languages indicates variables.
condition: ExpressionCondition of the rule.
is_private: boolIs the rule private.
is_global: boolIs the rule global.