Struct watchexec::action::PreSpawn [−][src]
#[non_exhaustive]pub struct PreSpawn {
pub command: Vec<String>,
pub events: Arc<Vec<Event>>,
// some fields omitted
}
Expand description
The environment given to the pre-spawn handler.
This deliberately does not implement Clone to make it hard to move it out of the handler, which you should not do.
The PreSpawn::command()
method is the only way to mutate the command, and the mutex guard it
returns must be dropped before the handler returns.
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.command: Vec<String>
The command which is about to be spawned.
This is the final command, after the Shell
has been applied.
events: Arc<Vec<Event>>
The collected events which triggered the action this command issues from.
Implementations
Get write access to the command that will be spawned.
Keeping the lock alive beyond the end of the handler may cause the command to be cancelled,
but note no guarantees are made on this behaviour. Just don’t do it. See the Action
documentation about handlers for more.
This will always return Some()
under normal circumstances.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for PreSpawn
impl !UnwindSafe for PreSpawn
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more