pub struct SemanticRulePattern {
pub minimum_operations: usize,
pub permitted_kinds: &'static [OperationKind],
}Expand description
A declarative, closed SOG pattern for one registered semantic rule.
This deliberately describes only which operation kinds a rule may accept and its minimum length. A rule must still provide a concrete matcher; the pattern is a fail-closed precondition, not a generic graph-rewrite DSL.
Fields§
§minimum_operations: usizeThe least number of operations that make the registered pattern useful.
permitted_kinds: &'static [OperationKind]Every node kind the rule may explain, in any permitted source order.
Implementations§
Source§impl SemanticRulePattern
impl SemanticRulePattern
Sourcepub fn accepts(self, graph: &SemanticOperationGraph) -> bool
pub fn accepts(self, graph: &SemanticOperationGraph) -> bool
Whether a graph lies entirely inside this rule’s closed vocabulary.
Trait Implementations§
Source§impl Clone for SemanticRulePattern
impl Clone for SemanticRulePattern
Source§fn clone(&self) -> SemanticRulePattern
fn clone(&self) -> SemanticRulePattern
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SemanticRulePattern
Source§impl Debug for SemanticRulePattern
impl Debug for SemanticRulePattern
impl Eq for SemanticRulePattern
Source§impl PartialEq for SemanticRulePattern
impl PartialEq for SemanticRulePattern
impl StructuralPartialEq for SemanticRulePattern
Auto Trait Implementations§
impl Freeze for SemanticRulePattern
impl RefUnwindSafe for SemanticRulePattern
impl Send for SemanticRulePattern
impl Sync for SemanticRulePattern
impl Unpin for SemanticRulePattern
impl UnsafeUnpin for SemanticRulePattern
impl UnwindSafe for SemanticRulePattern
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.