pub enum DecisionTree {
Leaf {
arm_idx: usize,
bindings: Vec<(Name, Expr)>,
},
Switch {
scrutinee: Expr,
branches: Vec<(Name, Vec<Name>, DecisionTree)>,
default: Option<Box<DecisionTree>>,
},
Failure,
}Expand description
A decision tree node.
Variants§
Leaf
Leaf: execute this arm’s RHS
Fields
Switch
Switch on a variable by constructor
Fields
§
default: Option<Box<DecisionTree>>Default branch (if not all constructors are listed)
Failure
Failure: no match (should not occur in well-typed code)
Trait Implementations§
Source§impl Clone for DecisionTree
impl Clone for DecisionTree
Auto Trait Implementations§
impl !Send for DecisionTree
impl !Sync for DecisionTree
impl Forget for DecisionTree
impl Freeze for DecisionTree
impl Move for DecisionTree
impl RefUnwindSafe for DecisionTree
impl Unpin for DecisionTree
impl UnsafeUnpin for DecisionTree
impl UnwindSafe for DecisionTree
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