pub enum Piece {
Var {
name: &'static str,
index: usize,
},
Int(i128),
Computed {
text: &'static str,
work: fn(&[Option<i128>]) -> Option<i128>,
},
App {
head: &'static str,
arity: usize,
},
}Expand description
One piece of a replacement, in the pre-order that builds it.
Variants§
Var
Whatever the pattern bound at this position.
Fields
Int(i128)
A constant written in the rule.
Computed
A constant the rule works out from the ones the pattern matched.
This is what lets a rule be written once per width rather than once per constant. A shift that stands in for a multiplication by a power of two shifts by the log of that power, and the log is a number no rule can write down until it has seen which power it matched.
Fields
App
A term the rule writes, which is an instruction once the caller has built it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Piece
impl RefUnwindSafe for Piece
impl Send for Piece
impl Sync for Piece
impl Unpin for Piece
impl UnsafeUnpin for Piece
impl UnwindSafe for Piece
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