pub struct Config { /* private fields */ }
Expand description

Watcher Backend configuration

This contains multiple settings that may relate to only one specific backend, such as to correctly configure each backend regardless of what is selected during runtime.

let config = Config::default()
    .with_poll_interval(Duration::from_secs(2))
    .with_compare_contents(true);

Some options can be changed during runtime, others have to be set when creating the watcher backend.

Implementations

For crate::PollWatcher

Interval between each rescan attempt. This can be extremely expensive for large file trees so it is recommended to measure and tune accordingly.

The default poll frequency is 30 seconds.

Returns current setting

For crate::PollWatcher

Optional feature that will evaluate the contents of changed files to determine if they have indeed changed using a fast hashing algorithm. This is especially important for pseudo filesystems like those on Linux under /sys and /proc which are not obligated to respect any other filesystem norms such as modification timestamps, file sizes, etc. By enabling this feature, performance will be significantly impacted as all files will need to be read and hashed at each poll_interval.

This can’t be changed during runtime. Off by default.

Returns current setting

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

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.