pub struct MatchStats {
pub num_arms: usize,
pub reachable_arms: Vec<usize>,
pub unreachable_arms: Vec<usize>,
pub is_exhaustive: bool,
pub tree_depth: usize,
}Expand description
Statistics about a compiled match expression.
Fields§
§num_arms: usizeNumber of arms in the original match.
reachable_arms: Vec<usize>Indices of arms that are actually reachable.
unreachable_arms: Vec<usize>Indices of arms that are unreachable (redundant).
is_exhaustive: boolWhether the match is exhaustive (covers all cases).
tree_depth: usizeDepth of the generated decision tree.
Implementations§
Source§impl MatchStats
impl MatchStats
Sourcepub fn is_exhaustive(&self) -> bool
pub fn is_exhaustive(&self) -> bool
Returns true if all arms are reachable.
Sourcepub fn has_redundant_arms(&self) -> bool
pub fn has_redundant_arms(&self) -> bool
Returns true if there are any redundant (unreachable) arms.
Trait Implementations§
Source§impl Clone for MatchStats
impl Clone for MatchStats
Source§fn clone(&self) -> MatchStats
fn clone(&self) -> MatchStats
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 MatchStats
impl RefUnwindSafe for MatchStats
impl Send for MatchStats
impl Sync for MatchStats
impl Unpin for MatchStats
impl UnsafeUnpin for MatchStats
impl UnwindSafe for MatchStats
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