Struct libafl::events::centralized::CentralizedEventManager
source · pub struct CentralizedEventManager<EM, EMH, S, SP>{ /* private fields */ }
Expand description
A wrapper manager to implement a main-secondary architecture with another broker
Implementations§
source§impl CentralizedEventManager<NopEventManager<NopState<NopInput>>, (), NopState<NopInput>, NopShMemProvider>
impl CentralizedEventManager<NopEventManager<NopState<NopInput>>, (), NopState<NopInput>, NopShMemProvider>
sourcepub fn builder() -> CentralizedEventManagerBuilder
pub fn builder() -> CentralizedEventManagerBuilder
Creates a builder for CentralizedEventManager
source§impl<EM, EMH, S, SP> CentralizedEventManager<EM, EMH, S, SP>
impl<EM, EMH, S, SP> CentralizedEventManager<EM, EMH, S, SP>
sourcepub fn describe(&self) -> Result<LlmpClientDescription, Error>
pub fn describe(&self) -> Result<LlmpClientDescription, Error>
Describe the client event manager’s LLMP parts in a restorable fashion
sourcepub fn to_env(&self, env_name: &str)
pub fn to_env(&self, env_name: &str)
Write the config for a client EventManager
to env vars, a new
client can reattach using CentralizedEventManagerBuilder::build_existing_client_from_env()
.
Trait Implementations§
source§impl<EM, EMH, S, SP> AdaptiveSerializer for CentralizedEventManager<EM, EMH, S, SP>where
EM: AdaptiveSerializer + UsesState,
EMH: EventManagerHooksTuple<EM::State>,
S: State,
SP: ShMemProvider,
impl<EM, EMH, S, SP> AdaptiveSerializer for CentralizedEventManager<EM, EMH, S, SP>where
EM: AdaptiveSerializer + UsesState,
EMH: EventManagerHooksTuple<EM::State>,
S: State,
SP: ShMemProvider,
source§fn serialization_time(&self) -> Duration
fn serialization_time(&self) -> Duration
Expose the collected observers serialization time
source§fn deserialization_time(&self) -> Duration
fn deserialization_time(&self) -> Duration
Expose the collected observers deserialization time
source§fn serializations_cnt(&self) -> usize
fn serializations_cnt(&self) -> usize
How many times observers were serialized
source§fn should_serialize_cnt(&self) -> usize
fn should_serialize_cnt(&self) -> usize
How many times shoukd have been serialized an observer
source§fn serialization_time_mut(&mut self) -> &mut Duration
fn serialization_time_mut(&mut self) -> &mut Duration
Expose the collected observers serialization time (mut)
source§fn deserialization_time_mut(&mut self) -> &mut Duration
fn deserialization_time_mut(&mut self) -> &mut Duration
Expose the collected observers deserialization time (mut)
source§fn serializations_cnt_mut(&mut self) -> &mut usize
fn serializations_cnt_mut(&mut self) -> &mut usize
How many times observers were serialized (mut)
source§fn should_serialize_cnt_mut(&mut self) -> &mut usize
fn should_serialize_cnt_mut(&mut self) -> &mut usize
How many times shoukd have been serialized an observer (mut)
source§fn time_ref(&self) -> &Option<Handle<TimeObserver>>
fn time_ref(&self) -> &Option<Handle<TimeObserver>>
A
Handle
to the time observer to determine the time_factor
source§fn serialize_observers_adaptive<S, OT>(
&mut self,
observers: &OT,
time_factor: u32,
percentage_threshold: usize,
) -> Result<Option<Vec<u8>>, Error>
fn serialize_observers_adaptive<S, OT>( &mut self, observers: &OT, time_factor: u32, percentage_threshold: usize, ) -> Result<Option<Vec<u8>>, Error>
Serialize the observer using the
time_factor
and percentage_threshold
.
These parameters are unique to each of the different types of EventManager
source§impl<EM, EMH, S, SP> Debug for CentralizedEventManager<EM, EMH, S, SP>where
EM: UsesState + Debug,
EMH: EventManagerHooksTuple<EM::State> + Debug,
S: State + Debug,
SP: ShMemProvider + Debug,
impl<EM, EMH, S, SP> Debug for CentralizedEventManager<EM, EMH, S, SP>where
EM: UsesState + Debug,
EMH: EventManagerHooksTuple<EM::State> + Debug,
S: State + Debug,
SP: ShMemProvider + Debug,
source§impl<EM, EMH, S, SP> EventFirer for CentralizedEventManager<EM, EMH, S, SP>where
EM: AdaptiveSerializer + EventFirer + HasEventManagerId,
EMH: EventManagerHooksTuple<EM::State>,
S: State,
SP: ShMemProvider,
impl<EM, EMH, S, SP> EventFirer for CentralizedEventManager<EM, EMH, S, SP>where
EM: AdaptiveSerializer + EventFirer + HasEventManagerId,
EMH: EventManagerHooksTuple<EM::State>,
S: State,
SP: ShMemProvider,
source§fn should_send(&self) -> bool
fn should_send(&self) -> bool
Return if we really send this event or not
source§fn fire(
&mut self,
state: &mut Self::State,
event: Event<<Self::State as UsesInput>::Input>,
) -> Result<(), Error>
fn fire( &mut self, state: &mut Self::State, event: Event<<Self::State as UsesInput>::Input>, ) -> Result<(), Error>
source§fn log(
&mut self,
state: &mut Self::State,
severity_level: LogSeverity,
message: String,
) -> Result<(), Error>
fn log( &mut self, state: &mut Self::State, severity_level: LogSeverity, message: String, ) -> Result<(), Error>
Send off an
Event::Log
event to the broker.
This is a shortcut for EventFirer::fire
with Event::Log
as argument.source§fn serialize_observers<OT>(
&mut self,
observers: &OT,
) -> Result<Option<Vec<u8>>, Error>
fn serialize_observers<OT>( &mut self, observers: &OT, ) -> Result<Option<Vec<u8>>, Error>
Serialize all observers for this type and manager
source§fn configuration(&self) -> EventConfig
fn configuration(&self) -> EventConfig
Get the configuration
source§impl<E, EM, EMH, S, SP, Z> EventProcessor<E, Z> for CentralizedEventManager<EM, EMH, S, SP>where
EM: AdaptiveSerializer + EventProcessor<E, Z> + EventFirer + HasEventManagerId,
EMH: EventManagerHooksTuple<EM::State>,
E: HasObservers<State = Self::State> + Executor<Self, Z>,
<E as UsesObservers>::Observers: Serialize,
for<'a> E::Observers: Deserialize<'a>,
S: State,
Self::State: HasExecutions + HasMetadata,
SP: ShMemProvider,
Z: EvaluatorObservers<E::Observers, State = Self::State> + ExecutionProcessor<State = Self::State>,
impl<E, EM, EMH, S, SP, Z> EventProcessor<E, Z> for CentralizedEventManager<EM, EMH, S, SP>where
EM: AdaptiveSerializer + EventProcessor<E, Z> + EventFirer + HasEventManagerId,
EMH: EventManagerHooksTuple<EM::State>,
E: HasObservers<State = Self::State> + Executor<Self, Z>,
<E as UsesObservers>::Observers: Serialize,
for<'a> E::Observers: Deserialize<'a>,
S: State,
Self::State: HasExecutions + HasMetadata,
SP: ShMemProvider,
Z: EvaluatorObservers<E::Observers, State = Self::State> + ExecutionProcessor<State = Self::State>,
source§impl<EM, EMH, S, SP> EventRestarter for CentralizedEventManager<EM, EMH, S, SP>
impl<EM, EMH, S, SP> EventRestarter for CentralizedEventManager<EM, EMH, S, SP>
source§fn on_restart(&mut self, state: &mut Self::State) -> Result<(), Error>
fn on_restart(&mut self, state: &mut Self::State) -> Result<(), Error>
For restarting event managers, implement a way to forward state to their next peers.
You must ensure that
HasCurrentStage::on_restart
will be invoked in this method, by you
or an internal EventRestarter
, before the state is saved for recovery.source§fn send_exiting(&mut self) -> Result<(), Error>
fn send_exiting(&mut self) -> Result<(), Error>
Send information that this client is exiting.
No need to restart us any longer, and no need to print an error, either.
source§fn await_restart_safe(&mut self)
fn await_restart_safe(&mut self)
Block until we are safe to exit, usually called inside
on_restart
.source§impl<EM, EMH, S, SP> HasCustomBufHandlers for CentralizedEventManager<EM, EMH, S, SP>where
EM: HasCustomBufHandlers,
EMH: EventManagerHooksTuple<EM::State>,
S: State,
SP: ShMemProvider,
impl<EM, EMH, S, SP> HasCustomBufHandlers for CentralizedEventManager<EM, EMH, S, SP>where
EM: HasCustomBufHandlers,
EMH: EventManagerHooksTuple<EM::State>,
S: State,
SP: ShMemProvider,
source§impl<EM, EMH, S, SP> HasEventManagerId for CentralizedEventManager<EM, EMH, S, SP>where
EM: HasEventManagerId + UsesState,
EMH: EventManagerHooksTuple<EM::State>,
S: State,
SP: ShMemProvider,
impl<EM, EMH, S, SP> HasEventManagerId for CentralizedEventManager<EM, EMH, S, SP>where
EM: HasEventManagerId + UsesState,
EMH: EventManagerHooksTuple<EM::State>,
S: State,
SP: ShMemProvider,
source§fn mgr_id(&self) -> EventManagerId
fn mgr_id(&self) -> EventManagerId
The id of this manager. For Multiprocessed
EventManager
s,
each client should have a unique ids.source§impl<EM, EMH, S, SP> ProgressReporter for CentralizedEventManager<EM, EMH, S, SP>where
EM: AdaptiveSerializer + ProgressReporter + HasEventManagerId,
EM::State: HasMetadata + HasExecutions + HasLastReportTime,
EMH: EventManagerHooksTuple<EM::State>,
S: State,
SP: ShMemProvider,
impl<EM, EMH, S, SP> ProgressReporter for CentralizedEventManager<EM, EMH, S, SP>where
EM: AdaptiveSerializer + ProgressReporter + HasEventManagerId,
EM::State: HasMetadata + HasExecutions + HasLastReportTime,
EMH: EventManagerHooksTuple<EM::State>,
S: State,
SP: ShMemProvider,
source§fn maybe_report_progress(
&mut self,
state: &mut Self::State,
monitor_timeout: Duration,
) -> Result<(), Error>
fn maybe_report_progress( &mut self, state: &mut Self::State, monitor_timeout: Duration, ) -> Result<(), Error>
Given the last time, if
monitor_timeout
seconds passed, send off an info/monitor/heartbeat message to the broker.
Returns the new last
time (so the old one, unless monitor_timeout
time has passed and monitor have been sent)
Will return an Error
, if the stats could not be sent.source§impl<EM, EMH, S, SP> UsesState for CentralizedEventManager<EM, EMH, S, SP>
impl<EM, EMH, S, SP> UsesState for CentralizedEventManager<EM, EMH, S, SP>
impl<E, EM, EMH, S, SP, Z> EventManager<E, Z> for CentralizedEventManager<EM, EMH, S, SP>where
E: HasObservers<State = Self::State> + Executor<Self, Z>,
<E as UsesObservers>::Observers: Serialize,
for<'a> E::Observers: Deserialize<'a>,
EM: AdaptiveSerializer + EventManager<E, Z>,
EM::State: HasExecutions + HasMetadata + HasLastReportTime,
EMH: EventManagerHooksTuple<EM::State>,
S: State,
SP: ShMemProvider,
Z: EvaluatorObservers<E::Observers, State = Self::State> + ExecutionProcessor<State = Self::State>,
Auto Trait Implementations§
impl<EM, EMH, S, SP> Freeze for CentralizedEventManager<EM, EMH, S, SP>
impl<EM, EMH, S, SP> RefUnwindSafe for CentralizedEventManager<EM, EMH, S, SP>where
EM: RefUnwindSafe,
EMH: RefUnwindSafe,
S: RefUnwindSafe,
SP: RefUnwindSafe,
<SP as ShMemProvider>::ShMem: RefUnwindSafe,
impl<EM, EMH, S, SP> !Send for CentralizedEventManager<EM, EMH, S, SP>
impl<EM, EMH, S, SP> !Sync for CentralizedEventManager<EM, EMH, S, SP>
impl<EM, EMH, S, SP> Unpin for CentralizedEventManager<EM, EMH, S, SP>
impl<EM, EMH, S, SP> UnwindSafe for CentralizedEventManager<EM, EMH, S, SP>where
EM: UnwindSafe,
EMH: UnwindSafe,
S: UnwindSafe,
SP: UnwindSafe,
<SP as ShMemProvider>::ShMem: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> FmtForward for T
impl<T> FmtForward for T
source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self
to use its Binary
implementation when Debug
-formatted.source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self
to use its Display
implementation when
Debug
-formatted.source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self
to use its LowerExp
implementation when
Debug
-formatted.source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self
to use its LowerHex
implementation when
Debug
-formatted.source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self
to use its Octal
implementation when Debug
-formatted.source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self
to use its Pointer
implementation when
Debug
-formatted.source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self
to use its UpperExp
implementation when
Debug
-formatted.source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self
to use its UpperHex
implementation when
Debug
-formatted.source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self
, then passes self.as_ref()
into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self
, then passes self.as_mut()
into the pipe
function.source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self
, then passes self.deref()
into the pipe function.source§impl<Tail, T> Prepend<T> for Tail
impl<Tail, T> Prepend<T> for Tail
§type PreprendResult = 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)
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> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B>
of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B>
of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R>
view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R>
view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target
of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target
of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref()
only in debug builds, and is erased in release
builds.source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds.source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref()
only in debug builds, and is erased in release
builds.