pub struct ProcessingMode {
pub rules: Vec<ConstructionRule>,
pub default_rule: Option<Value>,
}Expand description
Processing mode containing construction rules
Corresponds to OpenJade’s ProcessingMode class.
Stores all element construction rules defined in the template.
Fields§
§rules: Vec<ConstructionRule>Construction rules indexed by element name In OpenJade, rules are stored in intrusive linked lists and indexed lazily. We use a simple Vec for now - can optimize later with HashMap if needed.
default_rule: Option<Value>Default construction rule (fallback when no specific rule matches)
Implementations§
Source§impl ProcessingMode
impl ProcessingMode
Sourcepub fn add_rule(
&mut self,
element_name: String,
expr: Value,
source_file: Option<String>,
source_pos: Option<Position>,
)
pub fn add_rule( &mut self, element_name: String, expr: Value, source_file: Option<String>, source_pos: Option<Position>, )
Add a construction rule
Sourcepub fn add_default_rule(&mut self, expr: Value)
pub fn add_default_rule(&mut self, expr: Value)
Add a default construction rule
Sourcepub fn find_match(&self, gi: &str) -> Option<&ConstructionRule>
pub fn find_match(&self, gi: &str) -> Option<&ConstructionRule>
Find matching rule for an element
Corresponds to OpenJade’s ProcessingMode::findMatch().
Returns the first rule matching the given element name.
Auto Trait Implementations§
impl !Freeze for ProcessingMode
impl !RefUnwindSafe for ProcessingMode
impl !Send for ProcessingMode
impl !Sync for ProcessingMode
impl Unpin for ProcessingMode
impl !UnwindSafe for ProcessingMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more