diff --git a/notify-debouncer-full/src/lib.rs b/notify-debouncer-full/src/lib.rs index 0996fd66..809037e0 100644 --- a/notify-debouncer-full/src/lib.rs +++ b/notify-debouncer-full/src/lib.rs @@ -532,7 +532,7 @@ pub struct Debouncer { impl Debouncer { /// Stop the debouncer, waits for the event thread to finish. - /// May block for the duration of one tick_rate. + /// May block for the duration of one `tick_rate`. pub fn stop(mut self) { self.set_stop(); if let Some(t) = self.debouncer_thread.take() { @@ -616,7 +616,7 @@ impl Drop for Debouncer { /// /// Timeout is the amount of time after which a debounced event is emitted. /// -/// If tick_rate is None, notify will select a tick rate that is 1/4 of the provided timeout. +/// If `tick_rate` is `None`, notify will select a tick rate that is 1/4 of the provided timeout. pub fn new_debouncer_opt( timeout: Duration, tick_rate: Option, @@ -698,7 +698,7 @@ pub fn new_debouncer_opt( timeout: Duration, tick_rate: Option, diff --git a/notify-debouncer-mini/src/lib.rs b/notify-debouncer-mini/src/lib.rs index 84f30209..d4470b3f 100644 --- a/notify-debouncer-mini/src/lib.rs +++ b/notify-debouncer-mini/src/lib.rs @@ -264,7 +264,7 @@ impl DebounceDataInner { /// Updates the deadline if none is set or when batch mode is disabled and the current deadline would miss the next event. /// The new deadline is calculated based on the last event update time and the debounce timeout. /// - /// can't sub-function this due to event_map.drain() holding &mut self + /// can't sub-function this due to `event_map.drain()` holding `&mut self` fn check_deadline( batch_mode: bool, timeout: Duration, diff --git a/notify/src/config.rs b/notify/src/config.rs index a588eb78..c80d4aab 100644 --- a/notify/src/config.rs +++ b/notify/src/config.rs @@ -37,22 +37,22 @@ impl RecursiveMode { /// Some options can be changed during runtime, others have to be set when creating the watcher backend. #[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)] pub struct Config { - /// See [BackendConfig::with_poll_interval] + /// See [`BackendConfig::with_poll_interval`] poll_interval: Option, - /// See [BackendConfig::with_compare_contents] + /// See [`BackendConfig::with_compare_contents`] compare_contents: bool, } impl Config { - /// For the [PollWatcher](crate::PollWatcher) backend. + /// For the [`PollWatcher`](crate::PollWatcher) backend. /// /// Interval between each re-scan 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. /// - /// This will enable automatic polling, overwriting [with_manual_polling](Config::with_manual_polling). + /// This will enable automatic polling, overwriting [`with_manual_polling`](Config::with_manual_polling). pub fn with_poll_interval(mut self, dur: Duration) -> Self { // TODO: v7.0 break signature to option self.poll_interval = Some(dur); @@ -65,17 +65,17 @@ impl Config { self.poll_interval } - /// For the [PollWatcher](crate::PollWatcher) backend. + /// For the [`PollWatcher`](crate::PollWatcher) backend. /// - /// Disable automatic polling. Requires calling [crate::PollWatcher::poll] manually. + /// Disable automatic polling. Requires calling [`crate::PollWatcher::poll`] manually. /// - /// This will disable automatic polling, overwriting [with_poll_interval](Config::with_poll_interval). + /// This will disable automatic polling, overwriting [`with_poll_interval`](Config::with_poll_interval). pub fn with_manual_polling(mut self) -> Self { self.poll_interval = None; self } - /// For the [PollWatcher](crate::PollWatcher) backend. + /// For the [`PollWatcher`](crate::PollWatcher) backend. /// /// 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 diff --git a/notify/src/lib.rs b/notify/src/lib.rs index e7e8f909..d1d9ac68 100644 --- a/notify/src/lib.rs +++ b/notify/src/lib.rs @@ -34,12 +34,12 @@ //! Network mounted filesystems like NFS may not emit any events for notify to listen to. //! This applies especially to WSL programs watching windows paths ([issue #254](https://github.com/notify-rs/notify/issues/254)). //! -//! A workaround is the [PollWatcher] backend. +//! A workaround is the [`PollWatcher`] backend. //! //! ### Docker with Linux on MacOS M1 //! //! Docker on macos M1 [throws](https://github.com/notify-rs/notify/issues/423) `Function not implemented (os error 38)`. -//! You have to manually use the [PollWatcher], as the native backend isn't available inside the emulation. +//! You have to manually use the [`PollWatcher`], as the native backend isn't available inside the emulation. //! //! ### MacOS, FSEvents and unowned files //! @@ -62,7 +62,7 @@ //! ### Pseudo Filesystems like /proc, /sys //! //! Some filesystems like `/proc` and `/sys` on *nix do not emit change events or use correct file change dates. -//! To circumvent that problem you can use the [PollWatcher] with the `compare_contents` option. +//! To circumvent that problem you can use the [`PollWatcher`] with the `compare_contents` option. //! //! ### Linux: Bad File Descriptor / No space left on device //! @@ -76,7 +76,7 @@ //! sudo sysctl -p //! ``` //! -//! Note that the [PollWatcher] is not restricted by this limitation, so it may be an alternative if your users can't increase the limit. +//! Note that the [`PollWatcher`] is not restricted by this limitation, so it may be an alternative if your users can't increase the limit. //! //! ### Watching large directories //! diff --git a/notify/src/poll.rs b/notify/src/poll.rs index 007c178a..d7f7a8d4 100644 --- a/notify/src/poll.rs +++ b/notify/src/poll.rs @@ -18,8 +18,8 @@ use std::{ /// Event send for registered handler on initial directory scans pub type ScanEvent = crate::Result; -/// Handler trait for receivers of ScanEvent. -/// Very much the same as [EventHandler], but including the Result. +/// Handler trait for receivers of `ScanEvent`. +/// Very much the same as [`EventHandler`], but including the Result. /// /// See the full example for more information. pub trait ScanEventHandler: Send + 'static { @@ -483,7 +483,7 @@ pub struct PollWatcher { } impl PollWatcher { - /// Create a new [PollWatcher], configured as needed. + /// Create a new [`PollWatcher`], configured as needed. pub fn new(event_handler: F, config: Config) -> crate::Result { Self::with_opt::<_, ()>(event_handler, config, None) } @@ -496,7 +496,7 @@ impl PollWatcher { Ok(()) } - /// Create a new [PollWatcher] with an scan event handler. + /// Create a new [`PollWatcher`] with an scan event handler. /// /// `scan_fallback` is called on the initial scan with all files seen by the pollwatcher. pub fn with_initial_scan( @@ -507,7 +507,7 @@ impl PollWatcher { Self::with_opt(event_handler, config, Some(scan_callback)) } - /// create a new PollWatcher with all options + /// create a new `PollWatcher` with all options fn with_opt( event_handler: F, config: Config, @@ -607,7 +607,7 @@ impl PollWatcher { } impl Watcher for PollWatcher { - /// Create a new [PollWatcher]. + /// Create a new [`PollWatcher`]. fn new(event_handler: F, config: Config) -> crate::Result { Self::new(event_handler, config) }