Struct FilterTree
pub struct FilterTree { /* private fields */ }
Expand description
A tree-structure that can efficiently determine whether an instruction is covered by a large set of filters.
Implementations§
§impl FilterTree
impl FilterTree
pub fn new() -> FilterTree
pub fn new() -> FilterTree
Creates an empty FilterTree
.
pub fn count_nodes(&self) -> usize
pub fn count_nodes(&self) -> usize
Returns the number of nodes in use in the tree. Counts all nodes recursively.
pub fn filter(&mut self, filter: &InstructionFilter)
pub fn filter(&mut self, filter: &InstructionFilter)
Inserts the filter into the tree
pub fn prune(&mut self, instruction: &Instruction)
pub fn prune(&mut self, instruction: &Instruction)
Prunes the tree, removing matches before or furthest away from instruction
.
This operation reduces the memory used for the tree.
pub fn filter_below(&mut self, below: &Instruction)
pub fn filter_below(&mut self, below: &Instruction)
Filters all instruction below below
.
pub fn filter_above(&mut self, start: &Instruction)
pub fn filter_above(&mut self, start: &Instruction)
Filters all instruction above start
.
pub fn find_next(&self, instr: &Instruction) -> Option<Instruction>
pub fn find_next(&self, instr: &Instruction) -> Option<Instruction>
Returns the (lexicographically) next instruction not matched by any filter.
pub fn covers(&self, filter: &InstructionFilter) -> bool
pub fn covers(&self, filter: &InstructionFilter) -> bool
Returns true if the tree fully covers all instructions matched by the filter.
Trait Implementations§
§impl Debug for FilterTree
impl Debug for FilterTree
§impl PartialEq for FilterTree
impl PartialEq for FilterTree
Auto Trait Implementations§
impl Freeze for FilterTree
impl RefUnwindSafe for FilterTree
impl Send for FilterTree
impl Sync for FilterTree
impl Unpin for FilterTree
impl UnwindSafe for FilterTree
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
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more