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
Source§fn clone(&self) -> DecisionTree
fn clone(&self) -> DecisionTree
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DecisionTree
impl RefUnwindSafe for DecisionTree
impl Send for DecisionTree
impl Sync 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