pub trait Feedback<I, S>: Named + Debugwhere
I: Input,
S: HasClientPerfMonitor,{
fn is_interesting<EM, OT>(
&mut self,
state: &mut S,
manager: &mut EM,
input: &I,
observers: &OT,
exit_kind: &ExitKind
) -> Result<bool, Error>
where
EM: EventFirer<I>,
OT: ObserversTuple<I, S>;
fn init_state(&mut self, _state: &mut S) -> Result<(), Error> { ... }
fn append_metadata(
&mut self,
_state: &mut S,
_testcase: &mut Testcase<I>
) -> Result<(), Error> { ... }
fn discard_metadata(
&mut self,
_state: &mut S,
_input: &I
) -> 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: &I,
observers: &OT,
exit_kind: &ExitKind
) -> Result<bool, Error>where
EM: EventFirer<I>,
OT: ObserversTuple<I, S>,
fn is_interesting<EM, OT>(
&mut self,
state: &mut S,
manager: &mut EM,
input: &I,
observers: &OT,
exit_kind: &ExitKind
) -> Result<bool, Error>where
EM: EventFirer<I>,
OT: ObserversTuple<I, 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
sourceimpl<I, S> Feedback<I, S> for ()where
I: Input,
S: HasClientPerfMonitor,
impl<I, S> Feedback<I, S> for ()where
I: Input,
S: HasClientPerfMonitor,
Hack to use () as empty Feedback
fn is_interesting<EM, OT>(
&mut self,
_state: &mut S,
_manager: &mut EM,
_input: &I,
_observers: &OT,
_exit_kind: &ExitKind
) -> Result<bool, Error>where
EM: EventFirer<I>,
OT: ObserversTuple<I, S>,
Implementors
impl<A, B, FL, I, S> Feedback<I, S> for CombinedFeedback<A, B, FL, I, S>where
A: Feedback<I, S>,
B: Feedback<I, S>,
FL: FeedbackLogic<A, B, I, S>,
I: Input,
S: HasClientPerfMonitor + Debug,
impl<A, I, S> Feedback<I, S> for NotFeedback<A, I, S>where
A: Feedback<I, S>,
I: Input,
S: HasClientPerfMonitor,
impl<F, I, O1, O2, S> Feedback<I, S> for DiffFeedback<F, O1, O2>where
F: FnMut(&O1, &O2) -> DiffResult,
I: Input,
S: HasMetadata + HasClientPerfMonitor,
O1: Observer<I, S> + PartialEq<O2>,
O2: Observer<I, S>,
impl<I, M, S> Feedback<I, S> for MapEqualityFeedback<M>where
I: Input,
M: MapObserver,
S: HasClientPerfMonitor,
impl<I, N, O, R, S, T> Feedback<I, S> for MapFeedback<I, N, O, R, S, T>where
T: PartialEq + Default + Copy + 'static + Serialize + DeserializeOwned + Debug,
R: Reducer<T>,
O: MapObserver<Entry = T>,
for<'it> O: AsIter<'it, Item = T>,
N: IsNovel<T>,
I: Input,
S: HasNamedMetadata + HasClientPerfMonitor + Debug,
impl<I, O, S> Feedback<I, S> for MapFeedback<I, DifferentIsNovel, O, MaxReducer, S, u8>where
O: MapObserver<Entry = u8> + AsSlice<u8>,
for<'it> O: AsIter<'it, Item = u8>,
I: Input,
S: HasNamedMetadata + HasClientPerfMonitor + Debug,
Specialize for the common coverage map size, maximization of u8s