pub struct MapFeedback<N, O, R, S, T> { /* private fields */ }
Expand description

The most common AFL-like feedback type

Implementations§

source§

impl<N, O, R, S, T> MapFeedback<N, O, R, S, T>where
    T: PartialEq + Default + Copy + 'static + Serialize + DeserializeOwned + Debug,
    R: Reducer<T>,
    for<'it> O: MapObserver<Entry = T> + AsIter<'it, Item = T>,
    N: IsNovel<T>,
    S: UsesInput + HasNamedMetadata + HasClientPerfMonitor + Debug,

source

pub fn new(map_observer: &O) -> Self

Create new MapFeedback

source

pub fn new_tracking(
    map_observer: &O,
    track_indexes: bool,
    track_novelties: bool
) -> Self

Create new MapFeedback specifying if it must track indexes of used entries and/or novelties

source

pub fn with_names(name: &'static str, observer_name: &'static str) -> Self

Create new MapFeedback

source

pub fn with_name(name: &'static str, map_observer: &O) -> Self

Creating a new MapFeedback with a specific name. This is usefully whenever the same feedback is needed twice, but with a different history. Using new() always results in the same name and therefore also the same history.

source

pub fn with_names_tracking(
    name: &'static str,
    observer_name: &'static str,
    track_indexes: bool,
    track_novelties: bool
) -> Self

Create new MapFeedback specifying if it must track indexes of used entries and/or novelties

Trait Implementations§

source§

impl<N: Clone, O: Clone, R: Clone, S: Clone, T: Clone> Clone for MapFeedback<N, O, R, S, T>

source§

fn clone(&self) -> MapFeedback<N, O, R, S, T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<N: Debug, O: Debug, R: Debug, S: Debug, T: Debug> Debug for MapFeedback<N, O, R, S, T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

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

source§

fn is_interesting<EM, OT>(
    &mut self,
    state: &mut S,
    manager: &mut EM,
    _input: &<S as UsesInput>::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
source§

fn init_state(&mut self, _state: &mut S) -> Result<(), Error>

Initializes the feedback state. This method is called after that the State is created.
source§

fn append_metadata(
    &mut self,
    _state: &mut S,
    _testcase: &mut Testcase<S::Input>
) -> Result<(), Error>

Append to the testcase the generated metadata in case of a new corpus item
source§

fn discard_metadata(
    &mut self,
    _state: &mut S,
    _input: &S::Input
) -> Result<(), Error>

Discard the stored metadata in case that the testcase is not added to the corpus
source§

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,

source§

fn discard_metadata(
    &mut self,
    _state: &mut S,
    _input: &<S as UsesInput>::Input
) -> Result<(), Error>

Discard the stored metadata in case that the testcase is not added to the corpus

source§

fn init_state(&mut self, state: &mut S) -> Result<(), Error>

Initializes the feedback state. This method is called after that the State is created.
source§

default fn is_interesting<EM, OT>(
    &mut self,
    state: &mut S,
    manager: &mut EM,
    input: &<S as UsesInput>::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
source§

fn append_metadata(
    &mut self,
    _state: &mut S,
    testcase: &mut Testcase<<S as UsesInput>::Input>
) -> Result<(), Error>

Append to the testcase the generated metadata in case of a new corpus item
source§

impl<N, O, R, S, T> HasObserverName for MapFeedback<N, O, R, S, T>where
    T: PartialEq + Default + Copy + 'static + Serialize + DeserializeOwned + Debug,
    R: Reducer<T>,
    N: IsNovel<T>,
    for<'it> O: MapObserver<Entry = T> + AsIter<'it, Item = T>,
    S: HasNamedMetadata,

source§

fn observer_name(&self) -> &str

The name associated with the observer
source§

impl<N, O, R, S, T> Named for MapFeedback<N, O, R, S, T>

source§

fn name(&self) -> &str

Provide the name of this element.

Auto Trait Implementations§

§

impl<N, O, R, S, T> RefUnwindSafe for MapFeedback<N, O, R, S, T>where
    N: RefUnwindSafe,
    O: RefUnwindSafe,
    R: RefUnwindSafe,
    S: RefUnwindSafe,
    T: RefUnwindSafe,

§

impl<N, O, R, S, T> Send for MapFeedback<N, O, R, S, T>where
    N: Send,
    O: Send,
    R: Send,
    S: Send,
    T: Send,

§

impl<N, O, R, S, T> Sync for MapFeedback<N, O, R, S, T>where
    N: Sync,
    O: Sync,
    R: Sync,
    S: Sync,
    T: Sync,

§

impl<N, O, R, S, T> Unpin for MapFeedback<N, O, R, S, T>where
    N: Unpin,
    O: Unpin,
    R: Unpin,
    S: Unpin,
    T: Unpin,

§

impl<N, O, R, S, T> UnwindSafe for MapFeedback<N, O, R, S, T>where
    N: UnwindSafe,
    O: UnwindSafe,
    R: UnwindSafe,
    S: UnwindSafe,
    T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere
    T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere
    U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<Tail, T> Prepend<T> for Tail

§

type PreprendResult = Tail

The Resulting TupleList, of an Prepend::prepend() call, including the prepended entry.
source§

fn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)

Prepend a value to this tuple, returning a new tuple with prepended value.
source§

impl<T> ToOwned for Twhere
    T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere
    U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
    U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.