logo

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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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