Trait libafl::events::EventManager[][src]

pub trait EventManager<I, S> where
    I: Input
{ fn process<CS, E, OT>(
        &mut self,
        state: &mut S,
        executor: &mut E,
        scheduler: &CS
    ) -> Result<usize, Error>
    where
        CS: CorpusScheduler<I, S>,
        E: Executor<I> + HasObservers<OT>,
        OT: ObserversTuple
;
fn fire(&mut self, state: &mut S, event: Event<I>) -> Result<(), Error>; fn serialize_observers<OT>(
        &mut self,
        observers: &OT
    ) -> Result<Vec<u8>, Error>
    where
        OT: ObserversTuple
, { ... }
fn deserialize_observers<OT>(
        &mut self,
        observers_buf: &[u8]
    ) -> Result<OT, Error>
    where
        OT: ObserversTuple
, { ... }
fn on_restart(&mut self, _state: &mut S) -> Result<(), Error> { ... }
fn await_restart_safe(&mut self) { ... } }

EventManager is the main communications hub. For the “normal” multi-processed mode, you may want to look into RestartingEventManager

Required methods

fn process<CS, E, OT>(
    &mut self,
    state: &mut S,
    executor: &mut E,
    scheduler: &CS
) -> Result<usize, Error> where
    CS: CorpusScheduler<I, S>,
    E: Executor<I> + HasObservers<OT>,
    OT: ObserversTuple
[src]

Fire an Event Lookup for incoming events and process them. Return the number of processes events or an error

fn fire(&mut self, state: &mut S, event: Event<I>) -> Result<(), Error>[src]

Send off an event to the broker

Loading content...

Provided methods

fn serialize_observers<OT>(&mut self, observers: &OT) -> Result<Vec<u8>, Error> where
    OT: ObserversTuple
[src]

Serialize all observers for this type and manager

fn deserialize_observers<OT>(
    &mut self,
    observers_buf: &[u8]
) -> Result<OT, Error> where
    OT: ObserversTuple
[src]

Deserialize all observers for this type and manager

fn on_restart(&mut self, _state: &mut S) -> Result<(), Error>[src]

For restarting event managers, implement a way to forward state to their next peers.

fn await_restart_safe(&mut self)[src]

Block until we are safe to exit.

Loading content...

Implementors

impl<I, S> EventManager<I, S> for NopEventManager<I, S> where
    I: Input
[src]

fn process<CS, E, OT>(
    &mut self,
    _state: &mut S,
    _executor: &mut E,
    _scheduler: &CS
) -> Result<usize, Error> where
    CS: CorpusScheduler<I, S>,
    E: Executor<I> + HasObservers<OT>,
    OT: ObserversTuple
[src]

fn fire(&mut self, _state: &mut S, _event: Event<I>) -> Result<(), Error>[src]

impl<I, S, SP, ST> EventManager<I, S> for LlmpEventManager<I, S, SP, ST> where
    I: Input,
    S: IfInteresting<I>,
    SP: ShMemProvider,
    ST: Stats
[src]

fn await_restart_safe(&mut self)[src]

The llmp client needs to wait until a broker mapped all pages, before shutting down. Otherwise, the OS may already have removed the shared maps,

fn process<CS, E, OT>(
    &mut self,
    state: &mut S,
    executor: &mut E,
    scheduler: &CS
) -> Result<usize, Error> where
    CS: CorpusScheduler<I, S>,
    E: Executor<I> + HasObservers<OT>,
    OT: ObserversTuple
[src]

fn fire(&mut self, _state: &mut S, event: Event<I>) -> Result<(), Error>[src]

impl<I, S, SP, ST> EventManager<I, S> for LlmpRestartingEventManager<I, S, SP, ST> where
    I: Input,
    S: IfInteresting<I> + Serialize,
    SP: ShMemProvider,
    ST: Stats
[src]

fn await_restart_safe(&mut self)[src]

The llmp client needs to wait until a broker mapped all pages, before shutting down. Otherwise, the OS may already have removed the shared maps,

fn on_restart(&mut self, state: &mut S) -> Result<(), Error>[src]

Reset the single page (we reuse it over and over from pos 0), then send the current state to the next runner.

fn process<CS, E, OT>(
    &mut self,
    state: &mut S,
    executor: &mut E,
    scheduler: &CS
) -> Result<usize, Error> where
    CS: CorpusScheduler<I, S>,
    E: Executor<I> + HasObservers<OT>,
    OT: ObserversTuple
[src]

fn fire(&mut self, state: &mut S, event: Event<I>) -> Result<(), Error>[src]

impl<I, S, ST> EventManager<I, S> for SimpleEventManager<I, S, ST> where
    I: Input,
    ST: Stats
[src]

fn process<CS, E, OT>(
    &mut self,
    state: &mut S,
    _executor: &mut E,
    _scheduler: &CS
) -> Result<usize, Error> where
    CS: CorpusScheduler<I, S>,
    E: Executor<I> + HasObservers<OT>,
    OT: ObserversTuple
[src]

fn fire(&mut self, _state: &mut S, event: Event<I>) -> Result<(), Error>[src]

Loading content...