pub trait Scheduler: UsesState {
    fn next(&self, state: &mut Self::State) -> Result<CorpusId, Error>;

    fn on_add(
        &self,
        _state: &mut Self::State,
        _idx: CorpusId
    ) -> Result<(), Error> { ... } fn on_replace(
        &self,
        _state: &mut Self::State,
        _idx: CorpusId,
        _prev: &Testcase<<Self::State as UsesInput>::Input>
    ) -> Result<(), Error> { ... } fn on_remove(
        &self,
        _state: &mut Self::State,
        _idx: CorpusId,
        _testcase: &Option<Testcase<<Self::State as UsesInput>::Input>>
    ) -> Result<(), Error> { ... } }
Expand description

The scheduler define how the fuzzer requests a testcase from the corpus. It has hooks to corpus add/replace/remove to allow complex scheduling algorithms to collect data.

Required Methods§

source

fn next(&self, state: &mut Self::State) -> Result<CorpusId, Error>

Gets the next entry

Provided Methods§

source

fn on_add(&self, _state: &mut Self::State, _idx: CorpusId) -> Result<(), Error>

Added an entry to the corpus at the given index

source

fn on_replace(
    &self,
    _state: &mut Self::State,
    _idx: CorpusId,
    _prev: &Testcase<<Self::State as UsesInput>::Input>
) -> Result<(), Error>

Replaced the given testcase at the given idx

source

fn on_remove(
    &self,
    _state: &mut Self::State,
    _idx: CorpusId,
    _testcase: &Option<Testcase<<Self::State as UsesInput>::Input>>
) -> Result<(), Error>

Removed the given entry from the corpus at the given index

Implementors§

source§

impl<'a, CS> Scheduler for CoverageAccountingScheduler<'a, CS>where
    CS: Scheduler,
    CS::State: HasCorpus + HasMetadata + HasRand + Debug,
    <CS::State as UsesInput>::Input: HasLen,

source§

impl<CS, F, M> Scheduler for MinimizerScheduler<CS, F, M>where
    CS: Scheduler,
    F: TestcaseScore<CS::State>,
    M: AsSlice<Entry = usize> + SerdeAny + HasRefCnt,
    CS::State: HasCorpus + HasMetadata + HasRand,

source§

impl<F, S> Scheduler for ProbabilitySamplingScheduler<F, S>where
    F: TestcaseScore<S>,
    S: HasCorpus + HasMetadata + HasRand,

source§

impl<F, S> Scheduler for WeightedScheduler<F, S>where
    F: TestcaseScore<S>,
    S: HasCorpus + HasMetadata + HasRand,

source§

impl<S> Scheduler for PowerQueueScheduler<S>where
    S: HasCorpus + HasMetadata,

source§

impl<S> Scheduler for QueueScheduler<S>where
    S: HasCorpus,

source§

impl<S> Scheduler for RandScheduler<S>where
    S: HasCorpus + HasRand,

source§

impl<S> Scheduler for TuneableScheduler<S>where
    S: HasCorpus + HasMetadata,