pub trait Evaluator<E, EM>: UsesState{
// Required methods
fn evaluate_input_events(
&mut self,
state: &mut Self::State,
executor: &mut E,
manager: &mut EM,
input: <Self::State as UsesInput>::Input,
send_events: bool
) -> Result<(ExecuteInputResult, Option<CorpusId>), Error>;
fn add_input(
&mut self,
state: &mut Self::State,
executor: &mut E,
manager: &mut EM,
input: <Self::State as UsesInput>::Input
) -> Result<CorpusId, Error>;
fn add_disabled_input(
&mut self,
state: &mut Self::State,
input: <Self::State as UsesInput>::Input
) -> Result<CorpusId, Error>;
// Provided method
fn evaluate_input(
&mut self,
state: &mut Self::State,
executor: &mut E,
manager: &mut EM,
input: <Self::State as UsesInput>::Input
) -> Result<(ExecuteInputResult, Option<CorpusId>), Error> { ... }
}
Expand description
Evaluate an input modifying the state of the fuzzer
Required Methods§
sourcefn evaluate_input_events(
&mut self,
state: &mut Self::State,
executor: &mut E,
manager: &mut EM,
input: <Self::State as UsesInput>::Input,
send_events: bool
) -> Result<(ExecuteInputResult, Option<CorpusId>), Error>
fn evaluate_input_events( &mut self, state: &mut Self::State, executor: &mut E, manager: &mut EM, input: <Self::State as UsesInput>::Input, send_events: bool ) -> Result<(ExecuteInputResult, Option<CorpusId>), Error>
Runs the input and triggers observers and feedback, returns if is interesting an (option) the index of the new testcase in the corpus This version has a boolean to decide if send events to the manager.
sourcefn add_input(
&mut self,
state: &mut Self::State,
executor: &mut E,
manager: &mut EM,
input: <Self::State as UsesInput>::Input
) -> Result<CorpusId, Error>
fn add_input( &mut self, state: &mut Self::State, executor: &mut E, manager: &mut EM, input: <Self::State as UsesInput>::Input ) -> Result<CorpusId, Error>
Runs the input and triggers observers and feedback.
Adds an input, to the corpus even if it’s not considered interesting
by the feedback
.
Returns the index
of the new testcase in the corpus.
Usually, you want to use Evaluator::evaluate_input
, unless you know what you are doing.
sourcefn add_disabled_input(
&mut self,
state: &mut Self::State,
input: <Self::State as UsesInput>::Input
) -> Result<CorpusId, Error>
fn add_disabled_input( &mut self, state: &mut Self::State, input: <Self::State as UsesInput>::Input ) -> Result<CorpusId, Error>
Adds the input to the corpus as disabled a input.
Used during initial corpus loading.
Disabled testcases are only used for splicing
Returns the index
of the new testcase in the corpus.
Usually, you want to use Evaluator::evaluate_input
, unless you know what you are doing.
Provided Methods§
sourcefn evaluate_input(
&mut self,
state: &mut Self::State,
executor: &mut E,
manager: &mut EM,
input: <Self::State as UsesInput>::Input
) -> Result<(ExecuteInputResult, Option<CorpusId>), Error>
fn evaluate_input( &mut self, state: &mut Self::State, executor: &mut E, manager: &mut EM, input: <Self::State as UsesInput>::Input ) -> Result<(ExecuteInputResult, Option<CorpusId>), Error>
Runs the input and triggers observers and feedback,
returns if is interesting an (option) the index of the new crate::corpus::Testcase
in the corpus