Trait Scheduler

Source
pub trait Scheduler<I, S> {
    // Required methods
    fn on_add(&mut self, _state: &mut S, _id: CorpusId) -> Result<(), Error>;
    fn next(&mut self, state: &mut S) -> Result<CorpusId, Error>;
    fn set_current_scheduled(
        &mut self,
        state: &mut S,
        next_id: Option<CorpusId>,
    ) -> Result<(), Error>;

    // Provided method
    fn on_evaluation<OT>(
        &mut self,
        _state: &mut S,
        _input: &I,
        _observers: &OT,
    ) -> Result<(), Error>
       where OT: MatchName { ... }
}
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 on_add(&mut self, _state: &mut S, _id: CorpusId) -> Result<(), Error>

Called when a Testcase is added to the corpus

Source

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

Gets the next entry

Source

fn set_current_scheduled( &mut self, state: &mut S, next_id: Option<CorpusId>, ) -> Result<(), Error>

Set current fuzzed corpus id and scheduled_count

Provided Methods§

Source

fn on_evaluation<OT>( &mut self, _state: &mut S, _input: &I, _observers: &OT, ) -> Result<(), Error>
where OT: MatchName,

An input has been evaluated

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<C, F, I, O, S> Scheduler<I, S> for WeightedScheduler<C, F, O>
where C: AsRef<O> + Named, F: TestcaseScore<I, S>, O: Hash, S: HasCorpus<I> + HasMetadata + HasRand + HasTestcase<I>,

Source§

impl<C, I, O, S> Scheduler<I, S> for PowerQueueScheduler<C, O>
where S: HasCorpus<I> + HasMetadata + HasTestcase<I>, O: Hash, C: AsRef<O>,

Source§

impl<CS, F, I, M, O, S> Scheduler<I, S> for MinimizerScheduler<CS, F, I, M, O>
where CS: Scheduler<I, S>, F: TestcaseScore<I, S>, M: for<'a> AsIter<'a, Item = usize> + SerdeAny + HasRefCnt, S: HasCorpus<I> + HasMetadata + HasRand,

Source§

impl<CS, I, O, S> Scheduler<I, S> for CoverageAccountingScheduler<'_, CS, I, O>
where CS: Scheduler<I, S>, S: HasCorpus<I> + HasMetadata + HasRand, I: HasLen, O: CanTrack,

Source§

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

Source§

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

Source§

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

Source§

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