pub struct Sub {
pub from: Item,
pub to: SubTo,
pub before: Option<Item>,
pub not_before: Option<Item>,
pub after: Option<Item>,
pub not_after: Option<Item>,
pub group_count: usize,
pub reverse_run: Option<bool>,
pub when: Vec<String>,
}Fields§
§from: Item§to: SubTo§before: Option<Item>§not_before: Option<Item>§after: Option<Item>§not_after: Option<Item>§group_count: usizeNumber of capture groups in regex order (before, not_before, from, not_after, after).
reverse_run: Option<bool>Ruby reverse_run:: Some(true) skips the rule in the forward
direction and runs it in the reversed document (and vice versa).
The ISC grammar cannot express it; only Document::reverse
produces it.
when: Vec<String>ISC-WF-1 W3: the when language guards (§5). Empty = unguarded
(always applicable). A guarded rule applies only when the caller
selects one of these languages.
Implementations§
Source§impl Sub
impl Sub
Sourcepub fn max_length(&self) -> usize
pub fn max_length(&self) -> usize
Interscript::Node::Rule::Sub#max_length.
Sourcepub fn from_key(&self) -> String
pub fn from_key(&self) -> String
ISC-WF-1 W2/W3 canonical from-key: the structural rendering of the EXPANDED from item. For literal froms this is byte-exact string equality (the corpus convention — no Unicode normalization); non-literal froms (any()/alias trees) compare structurally, which is the exact-from generalization the spec’s “from(o) == from(r)” needs on resolved items.
Sourcepub fn guard_applies(&self, language: Option<&str>) -> bool
pub fn guard_applies(&self, language: Option<&str>) -> bool
W3 applicability: unguarded rules always apply; a guarded rule applies only when the caller selected one of its languages (§5.1 — no selection, or an undeclared selection, leaves every guard inert).