pub trait Feedback<S>: Namedwhere
S: State,{
// Required method
fn is_interesting<EM, OT>(
&mut self,
state: &mut S,
manager: &mut EM,
input: &S::Input,
observers: &OT,
exit_kind: &ExitKind
) -> Result<bool, Error>
where EM: EventFirer<State = S>,
OT: ObserversTuple<S>;
// Provided methods
fn init_state(&mut self, _state: &mut S) -> Result<(), Error> { ... }
fn is_interesting_introspection<EM, OT>(
&mut self,
state: &mut S,
manager: &mut EM,
input: &S::Input,
observers: &OT,
exit_kind: &ExitKind
) -> Result<bool, Error>
where EM: EventFirer<State = S>,
OT: ObserversTuple<S> { ... }
fn append_metadata<EM, OT>(
&mut self,
state: &mut S,
manager: &mut EM,
observers: &OT,
testcase: &mut Testcase<S::Input>
) -> Result<(), Error>
where OT: ObserversTuple<S>,
EM: EventFirer<State = S> { ... }
fn discard_metadata(
&mut self,
_state: &mut S,
_input: &S::Input
) -> Result<(), Error> { ... }
}
Expand description
Feedbacks evaluate the observers. Basically, they reduce the information provided by an observer to a value, indicating the “interestingness” of the last run.
Required Methods§
sourcefn is_interesting<EM, OT>(
&mut self,
state: &mut S,
manager: &mut EM,
input: &S::Input,
observers: &OT,
exit_kind: &ExitKind
) -> Result<bool, Error>where
EM: EventFirer<State = S>,
OT: ObserversTuple<S>,
fn is_interesting<EM, OT>(
&mut self,
state: &mut S,
manager: &mut EM,
input: &S::Input,
observers: &OT,
exit_kind: &ExitKind
) -> Result<bool, Error>where
EM: EventFirer<State = S>,
OT: ObserversTuple<S>,
is_interesting
return if an input is worth the addition to the corpus
Provided Methods§
sourcefn init_state(&mut self, _state: &mut S) -> Result<(), Error>
fn init_state(&mut self, _state: &mut S) -> Result<(), Error>
Initializes the feedback state.
This method is called after that the State
is created.
sourcefn is_interesting_introspection<EM, OT>(
&mut self,
state: &mut S,
manager: &mut EM,
input: &S::Input,
observers: &OT,
exit_kind: &ExitKind
) -> Result<bool, Error>where
EM: EventFirer<State = S>,
OT: ObserversTuple<S>,
fn is_interesting_introspection<EM, OT>(
&mut self,
state: &mut S,
manager: &mut EM,
input: &S::Input,
observers: &OT,
exit_kind: &ExitKind
) -> Result<bool, Error>where
EM: EventFirer<State = S>,
OT: ObserversTuple<S>,
Returns if the result of a run is interesting and the value input should be stored in a corpus. It also keeps track of introspection stats.
sourcefn append_metadata<EM, OT>(
&mut self,
state: &mut S,
manager: &mut EM,
observers: &OT,
testcase: &mut Testcase<S::Input>
) -> Result<(), Error>where
OT: ObserversTuple<S>,
EM: EventFirer<State = S>,
fn append_metadata<EM, OT>(
&mut self,
state: &mut S,
manager: &mut EM,
observers: &OT,
testcase: &mut Testcase<S::Input>
) -> Result<(), Error>where
OT: ObserversTuple<S>,
EM: EventFirer<State = S>,
Append to the testcase the generated metadata in case of a new corpus item
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl<S> Feedback<S> for ()where
S: State,
impl<S> Feedback<S> for ()where
S: State,
Hack to use () as empty Feedback
fn is_interesting<EM, OT>(
&mut self,
_state: &mut S,
_manager: &mut EM,
_input: &S::Input,
_observers: &OT,
_exit_kind: &ExitKind
) -> Result<bool, Error>where
EM: EventFirer<State = S>,
OT: ObserversTuple<S>,
Implementors§
impl<'a, S> Feedback<S> for NautilusFeedback<'a, S>
impl<A, B, FL, S> Feedback<S> for CombinedFeedback<A, B, FL, S>
impl<A, S> Feedback<S> for NotFeedback<A, S>
impl<C, N, O, R, S, T> Feedback<S> for MapFeedback<C, N, O, R, S, T>where
N: IsNovel<T>,
O: MapObserver<Entry = T> + for<'it> AsIter<'it, Item = T>,
R: Reducer<T>,
S: State + HasNamedMetadata,
T: Default + Copy + Serialize + for<'de> Deserialize<'de> + PartialEq + Debug + 'static,
C: CanTrack + AsRef<O>,
impl<C, O, S> Feedback<S> for MapFeedback<C, DifferentIsNovel, O, MaxReducer, S, u8>where
for<'it> O: MapObserver<Entry = u8> + AsSlice<Entry = u8> + AsIter<'it, Item = u8>,
S: State + HasNamedMetadata,
C: CanTrack + AsRef<O>,
Specialize for the common coverage map size, maximization of u8s