pub trait Subject {
type Node: Copy;
// Required methods
fn head(&self, node: Self::Node) -> Option<(&str, usize)>;
fn arg(&self, node: Self::Node, index: usize) -> Self::Node;
fn int(&self, node: Self::Node) -> Option<i128>;
}Expand description
The bits of a term the automaton asks about.
A node is whatever the thing doing the matching calls one of its terms: an IR value, an index into an arena, a pointer. It has to be cheap to copy because the walk keeps a stack of them.
Required Associated Types§
Required Methods§
Sourcefn head(&self, node: Self::Node) -> Option<(&str, usize)>
fn head(&self, node: Self::Node) -> Option<(&str, usize)>
The head of a term and how many arguments it has, or nothing if the term is not an application. An IR instruction answers with its opcode and its width, spelled the way the rule file spells it.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".