pub trait Feedback<S>: Named + Debugwhere
S: UsesInput + HasClientPerfMonitor,{
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>;
fn init_state(&mut self, _state: &mut S) -> Result<(), Error> { ... }
fn append_metadata(
&mut self,
_state: &mut S,
_testcase: &mut Testcase<S::Input>
) -> Result<(), Error> { ... }
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.
Implementations on Foreign Types§
source§impl<S> Feedback<S> for ()where
S: UsesInput + HasClientPerfMonitor,
impl<S> Feedback<S> for ()where
S: UsesInput + HasClientPerfMonitor,
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, B, FL, S> Feedback<S> for CombinedFeedback<A, B, FL, S>where
A: Feedback<S>,
B: Feedback<S>,
FL: FeedbackLogic<A, B, S>,
S: UsesInput + HasClientPerfMonitor + Debug,
impl<A, S> Feedback<S> for NotFeedback<A, S>where
A: Feedback<S>,
S: UsesInput + HasClientPerfMonitor,
impl<F, I, O1, O2, S> Feedback<S> for DiffFeedback<F, I, O1, O2, S>where
F: FnMut(&O1, &O2) -> DiffResult,
I: Input,
S: HasMetadata + HasClientPerfMonitor + State<Input = I>,
O1: Observer<S> + PartialEq<O2>,
O2: Observer<S>,
impl<M, S> Feedback<S> for MapEqualityFeedback<M, S>where
M: MapObserver + Debug,
S: UsesInput + HasClientPerfMonitor + Debug,
impl<N, O, R, S, T> Feedback<S> for MapFeedback<N, O, R, S, T>where
N: IsNovel<T> + Debug,
O: MapObserver<Entry = T> + for<'it> AsIter<'it, Item = T> + Debug,
R: Reducer<T> + Debug,
S: UsesInput + HasClientPerfMonitor + HasNamedMetadata + Debug,
T: Default + Copy + Serialize + for<'de> Deserialize<'de> + PartialEq + Debug + 'static,
impl<O, S> Feedback<S> for MapFeedback<DifferentIsNovel, O, MaxReducer, S, u8>where
for<'it> O: MapObserver<Entry = u8> + AsSlice<Entry = u8> + AsIter<'it, Item = u8>,
S: UsesInput + HasNamedMetadata + HasClientPerfMonitor + Debug,
Specialize for the common coverage map size, maximization of u8s