#[cfg(all(windows, feature = "std"))]
pub mod windows;
#[cfg(all(unix, feature = "std"))]
pub mod unix;
#[cfg(all(feature = "std", unix))]
pub mod inprocess_fork;
pub mod inprocess;
#[cfg(feature = "std")]
pub mod timer;
#[cfg(all(feature = "intel_pt", target_os = "linux"))]
pub mod intel_pt;
pub trait ExecutorHook<I, S> {
fn init(&mut self, state: &mut S);
fn pre_exec(&mut self, state: &mut S, input: &I);
fn post_exec(&mut self, state: &mut S, input: &I);
}
pub trait ExecutorHooksTuple<I, S> {
fn init_all(&mut self, state: &mut S);
fn pre_exec_all(&mut self, state: &mut S, input: &I);
fn post_exec_all(&mut self, state: &mut S, input: &I);
}
impl<I, S> ExecutorHooksTuple<I, S> for () {
fn init_all(&mut self, _state: &mut S) {}
fn pre_exec_all(&mut self, _state: &mut S, _input: &I) {}
fn post_exec_all(&mut self, _state: &mut S, _input: &I) {}
}
impl<Head, Tail, I, S> ExecutorHooksTuple<I, S> for (Head, Tail)
where
Head: ExecutorHook<I, S>,
Tail: ExecutorHooksTuple<I, S>,
{
fn init_all(&mut self, state: &mut S) {
self.0.init(state);
self.1.init_all(state);
}
fn pre_exec_all(&mut self, state: &mut S, input: &I) {
self.0.pre_exec(state, input);
self.1.pre_exec_all(state, input);
}
fn post_exec_all(&mut self, state: &mut S, input: &I) {
self.0.post_exec(state, input);
self.1.post_exec_all(state, input);
}
}