pub enum SemanticRuleMatcher {
EquivalentSequence,
ExactApiSequence {
api_names: &'static [&'static str],
},
DirectConstruct {
kind: OperationKind,
fallible_kind: FallibleKind,
direct_propagation: Option<DirectPropagation>,
},
ResourceLifecycle,
}Expand description
A closed, declarative matching strategy for a registered semantic rule.
This is deliberately a small enum rather than an open rewrite language: adding an unreviewed syntax form must not turn the registry into a general equivalence engine. Rules select a pre-audited strategy and provide all values that strategy needs in their declaration.
Variants§
EquivalentSequence
Match equal-length operation sequences when every aligned node has the same kind and compatible compiler-confirmed type evidence.
ExactApiSequence
Match a single closed compiler-confirmed API sequence. The operation kinds remain part of the rule pattern; these names prevent a generic pair of value transformations from being described as serialization.
Fields
DirectConstruct
Match exactly one compiler-confirmed construct with the supplied operation, fallible family, and optional direct-propagation form.
Fields
kind: OperationKindThe only operation kind the construct may carry.
fallible_kind: FallibleKindThe standard fallible family the helper must have resolved.
direct_propagation: Option<DirectPropagation>An additional closed direct-propagation fact, when required.
ResourceLifecycle
Match one compiler-confirmed acquire/release pair of the same closed resource category, including its explicit lifetime edge.
Trait Implementations§
Source§impl Clone for SemanticRuleMatcher
impl Clone for SemanticRuleMatcher
Source§fn clone(&self) -> SemanticRuleMatcher
fn clone(&self) -> SemanticRuleMatcher
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SemanticRuleMatcher
Source§impl Debug for SemanticRuleMatcher
impl Debug for SemanticRuleMatcher
impl Eq for SemanticRuleMatcher
Source§impl PartialEq for SemanticRuleMatcher
impl PartialEq for SemanticRuleMatcher
impl StructuralPartialEq for SemanticRuleMatcher
Auto Trait Implementations§
impl Freeze for SemanticRuleMatcher
impl RefUnwindSafe for SemanticRuleMatcher
impl Send for SemanticRuleMatcher
impl Sync for SemanticRuleMatcher
impl Unpin for SemanticRuleMatcher
impl UnsafeUnpin for SemanticRuleMatcher
impl UnwindSafe for SemanticRuleMatcher
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
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
key and return true if they are equal.