pub struct Term {
pub kind: TermKind,
pub line: u32,
pub column: u32,
}Expand description
A term: the pattern a rule matches, the replacement it produces, and the two clauses that constrain it are all one shape.
Fields§
§kind: TermKindWhich of the three kinds this is.
line: u32The line it starts on, counted from one.
column: u32The column it starts at, counted from one.
Implementations§
Source§impl Term
impl Term
Sourcepub fn walk<'t>(&'t self, visit: &mut impl FnMut(&'t Term))
pub fn walk<'t>(&'t self, visit: &mut impl FnMut(&'t Term))
Walk this term and everything under it, outermost first.
The lifetime is written out so that what the visitor is handed lives as long as the term does, which is what lets a caller collect the places it found rather than only count them.
Trait Implementations§
impl Eq for Term
impl StructuralPartialEq for Term
Auto Trait Implementations§
impl Freeze for Term
impl RefUnwindSafe for Term
impl Send for Term
impl Sync for Term
impl Unpin for Term
impl UnsafeUnpin for Term
impl UnwindSafe for Term
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