Expand description
A CommandExecutor
is a wrapper around std::process::Command
to execute a target as a child process.
Construct a CommandExecutor
by implementing CommandConfigurator
for a type of your choice and calling CommandConfigurator::into_executor
on it.
Instead, you can use CommandExecutor::builder()
to construct a CommandExecutor
backed by a StdCommandConfigurator
.
Implementations
sourceimpl CommandExecutor<(), (), (), (), (), ()>
impl CommandExecutor<(), (), (), (), (), ()>
sourcepub fn builder() -> CommandExecutorBuilder
pub fn builder() -> CommandExecutorBuilder
Creates a builder for a new CommandExecutor
,
backed by a StdCommandConfigurator
This is usually the easiest way to construct a CommandExecutor
.
It mimics the api of Command
, specifically, you will use
arg
, args
, env
, and so on.
By default, input is read from stdin, unless you specify a different location using
arg_input_arg
for input delivered as an command line argumentarg_input_file
for input via a file of a specific namearg_input_file_std
for a file with default name (at the right location in the arguments)
sourceimpl<EM, I, OT, S, T, Z> CommandExecutor<EM, I, OT, S, T, Z> where
T: Debug,
OT: Debug,
impl<EM, I, OT, S, T, Z> CommandExecutor<EM, I, OT, S, T, Z> where
T: Debug,
OT: Debug,
sourceimpl<EM, I, OT, S, Z> CommandExecutor<EM, I, OT, S, StdCommandConfigurator, Z> where
OT: MatchName + Debug,
impl<EM, I, OT, S, Z> CommandExecutor<EM, I, OT, S, StdCommandConfigurator, Z> where
OT: MatchName + Debug,
sourcepub fn from_cmd_with_file<P>(
cmd: &Command,
debug_child: bool,
observers: OT,
path: P
) -> Result<Self, Error> where
P: AsRef<Path>,
pub fn from_cmd_with_file<P>(
cmd: &Command,
debug_child: bool,
observers: OT,
path: P
) -> Result<Self, Error> where
P: AsRef<Path>,
Creates a new CommandExecutor
.
Instead of parsing the Command for @@
, it will
sourcepub fn parse_afl_cmdline<IT, O>(
args: IT,
observers: OT,
debug_child: bool
) -> Result<Self, Error> where
IT: IntoIterator<Item = O>,
O: AsRef<OsStr>,
pub fn parse_afl_cmdline<IT, O>(
args: IT,
observers: OT,
debug_child: bool
) -> Result<Self, Error> where
IT: IntoIterator<Item = O>,
O: AsRef<OsStr>,
Parses an AFL-like comandline, replacing @@
with the input file.
If no @@
was found, will use stdin for input.
The arg 0 is the program.
Trait Implementations
sourceimpl<EM, I, OT, S, T, Z> Debug for CommandExecutor<EM, I, OT, S, T, Z> where
T: Debug,
OT: Debug,
impl<EM, I, OT, S, T, Z> Debug for CommandExecutor<EM, I, OT, S, T, Z> where
T: Debug,
OT: Debug,
sourceimpl<EM, I, OT, S, T, Z> Executor<EM, I, S, Z> for CommandExecutor<EM, I, OT, S, T, Z> where
I: Input + HasTargetBytes,
T: CommandConfigurator,
OT: Debug + MatchName,
T: Debug,
impl<EM, I, OT, S, T, Z> Executor<EM, I, S, Z> for CommandExecutor<EM, I, OT, S, T, Z> where
I: Input + HasTargetBytes,
T: CommandConfigurator,
OT: Debug + MatchName,
T: Debug,
sourcefn run_target(
&mut self,
_fuzzer: &mut Z,
_state: &mut S,
_mgr: &mut EM,
input: &I
) -> Result<ExitKind, Error>
fn run_target(
&mut self,
_fuzzer: &mut Z,
_state: &mut S,
_mgr: &mut EM,
input: &I
) -> Result<ExitKind, Error>
Instruct the target about the input and run
sourcefn with_observers<OT>(self, observers: OT) -> WithObservers<Self, OT> where
Self: Sized,
OT: ObserversTuple<I, S>,
fn with_observers<OT>(self, observers: OT) -> WithObservers<Self, OT> where
Self: Sized,
OT: ObserversTuple<I, S>,
Wraps this Executor with the given ObserversTuple
to implement HasObservers
. Read more
sourcefn post_run_reset(&mut self)
fn post_run_reset(&mut self)
Custom Reset Handler, e.g., to reset timers
sourceimpl<EM, I, OT: ObserversTuple<I, S>, S, T: Debug, Z> HasObservers<I, OT, S> for CommandExecutor<EM, I, OT, S, T, Z>
impl<EM, I, OT: ObserversTuple<I, S>, S, T: Debug, Z> HasObservers<I, OT, S> for CommandExecutor<EM, I, OT, S, T, Z>
Auto Trait Implementations
impl<EM, I, OT, S, T, Z> RefUnwindSafe for CommandExecutor<EM, I, OT, S, T, Z> where
EM: RefUnwindSafe,
I: RefUnwindSafe,
OT: RefUnwindSafe,
S: RefUnwindSafe,
T: RefUnwindSafe,
Z: RefUnwindSafe,
impl<EM, I, OT, S, T, Z> Send for CommandExecutor<EM, I, OT, S, T, Z> where
EM: Send,
I: Send,
OT: Send,
S: Send,
T: Send,
Z: Send,
impl<EM, I, OT, S, T, Z> Sync for CommandExecutor<EM, I, OT, S, T, Z> where
EM: Sync,
I: Sync,
OT: Sync,
S: Sync,
T: Sync,
Z: Sync,
impl<EM, I, OT, S, T, Z> Unpin for CommandExecutor<EM, I, OT, S, T, Z> where
EM: Unpin,
I: Unpin,
OT: Unpin,
S: Unpin,
T: Unpin,
Z: Unpin,
impl<EM, I, OT, S, T, Z> UnwindSafe for CommandExecutor<EM, I, OT, S, T, Z> where
EM: UnwindSafe,
I: UnwindSafe,
OT: UnwindSafe,
S: UnwindSafe,
T: UnwindSafe,
Z: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<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. Read more
sourcefn 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.