Struct watchexec::config::InitConfig
source · [−]#[non_exhaustive]pub struct InitConfig {
pub error_handler: Box<dyn Handler<RuntimeError> + Send>,
pub error_channel_size: usize,
pub event_channel_size: usize,
}
Expand description
Initialisation configuration for Watchexec
.
This is used only for constructing the instance.
Use InitConfig::default()
to build a new one, and the inherent methods to change values.
This struct is marked non-exhaustive such that new options may be added without breaking change.
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.error_handler: Box<dyn Handler<RuntimeError> + Send>
Runtime error handler.
This is run on every runtime error that occurs within watchexec. By default the placeholder
()
handler is used, which discards all errors.
If the handler errors, that error is immediately given to the handler. If this second handler call errors as well, its error is ignored.
Examples
let mut init = InitConfig::default();
init.on_error(|err| async move {
tracing::error!("{}", err);
Ok::<(), Infallible>(())
});
error_channel_size: usize
Internal: the buffer size of the channel which carries runtime errors.
The default (64) is usually fine. If you expect a much larger throughput of runtime errors,
or if your error_handler
is slow, adjusting this value may help.
event_channel_size: usize
Internal: the buffer size of the channel which carries events.
The default (1024) is usually fine. If you expect a much larger throughput of events, adjusting this value may help.
Implementations
Set the runtime error handler.
See the documentation on the field for more details.
Set the buffer size of the channel which carries runtime errors.
See the documentation on the field for more details.
Set the buffer size of the channel which carries events.
See the documentation on the field for more details.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for InitConfig
impl Send for InitConfig
impl !Sync for InitConfig
impl Unpin for InitConfig
impl !UnwindSafe for InitConfig
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