pub trait PatternProvider: Debug {
type PatternNodeKey: Copy + Hash + Debug + PartialEq + Eq;
type PatternNodeKind: Copy + Hash + Debug + PartialEq + Eq;
type CfgVariable: Copy + Hash + Debug + PartialEq + Eq;
const WILDCARD: Self::PatternNodeKind;
// Required methods
fn get_root(
&self,
) -> ExpandedClauseNodes<Self::CfgVariable, Self::PatternNodeKey>;
fn kind_includes(
&self,
kind: Self::PatternNodeKind,
key: Self::PatternNodeKey,
) -> bool;
fn expand_clause_nodes(
&mut self,
clause_nodes: Vec<Self::PatternNodeKey>,
) -> ExpandedClauseNodes<Self::CfgVariable, Self::PatternNodeKey>;
fn get_kind(&self, key: Self::PatternNodeKey) -> Self::PatternNodeKind;
// Provided methods
fn is_wildcard(&self, kind: Self::PatternNodeKind) -> bool { ... }
fn get_wildcard(&self) -> Self::PatternNodeKind { ... }
}
Required Associated Constants§
const WILDCARD: Self::PatternNodeKind
Required Associated Types§
Required Methods§
fn get_root( &self, ) -> ExpandedClauseNodes<Self::CfgVariable, Self::PatternNodeKey>
Sourcefn kind_includes(
&self,
kind: Self::PatternNodeKind,
key: Self::PatternNodeKey,
) -> bool
fn kind_includes( &self, kind: Self::PatternNodeKind, key: Self::PatternNodeKey, ) -> bool
Used to determine if the given key
should be included in the
specialization on kind
.
When passed a wildcard as kind, we are specializing on the default matrix. It should match wildcards ONLY.
§Invariants
- Every
PatternNodeKey
should match on one and ONLY onePatternNodeKind
.
Sourcefn expand_clause_nodes(
&mut self,
clause_nodes: Vec<Self::PatternNodeKey>,
) -> ExpandedClauseNodes<Self::CfgVariable, Self::PatternNodeKey>
fn expand_clause_nodes( &mut self, clause_nodes: Vec<Self::PatternNodeKey>, ) -> ExpandedClauseNodes<Self::CfgVariable, Self::PatternNodeKey>
After clauses have been selected for specialization, this will be called with the set of all nodes that should be specialized on.
Sourcefn get_kind(&self, key: Self::PatternNodeKey) -> Self::PatternNodeKind
fn get_kind(&self, key: Self::PatternNodeKey) -> Self::PatternNodeKind
Every PatternNodeKey
should belong to one and only one
PatternNodeKind
.
Provided Methods§
fn is_wildcard(&self, kind: Self::PatternNodeKind) -> bool
fn get_wildcard(&self) -> Self::PatternNodeKind
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.