Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add some missing backticks. #616

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions notify-debouncer-full/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ pub struct Debouncer<T: Watcher, C: FileIdCache> {

impl<T: Watcher, C: FileIdCache> Debouncer<T, C> {
/// 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() {
Expand Down Expand Up @@ -616,7 +616,7 @@ impl<T: Watcher, C: FileIdCache> Drop for Debouncer<T, C> {
///
/// 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<F: DebounceEventHandler, T: Watcher, C: FileIdCache + Send + 'static>(
timeout: Duration,
tick_rate: Option<Duration>,
Expand Down Expand Up @@ -698,7 +698,7 @@ pub fn new_debouncer_opt<F: DebounceEventHandler, T: Watcher, C: FileIdCache + S
///
/// 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<F: DebounceEventHandler>(
timeout: Duration,
tick_rate: Option<Duration>,
Expand Down
2 changes: 1 addition & 1 deletion notify-debouncer-mini/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
16 changes: 8 additions & 8 deletions notify/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Duration>,

/// 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);
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions notify/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
//!
Expand All @@ -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
//!
Expand All @@ -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
//!
Expand Down
12 changes: 6 additions & 6 deletions notify/src/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ use std::{
/// Event send for registered handler on initial directory scans
pub type ScanEvent = crate::Result<PathBuf>;

/// 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 {
Expand Down Expand Up @@ -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<F: EventHandler>(event_handler: F, config: Config) -> crate::Result<PollWatcher> {
Self::with_opt::<_, ()>(event_handler, config, None)
}
Expand All @@ -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<F: EventHandler, G: ScanEventHandler>(
Expand All @@ -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<F: EventHandler, G: ScanEventHandler>(
event_handler: F,
config: Config,
Expand Down Expand Up @@ -607,7 +607,7 @@ impl PollWatcher {
}

impl Watcher for PollWatcher {
/// Create a new [PollWatcher].
/// Create a new [`PollWatcher`].
fn new<F: EventHandler>(event_handler: F, config: Config) -> crate::Result<Self> {
Self::new(event_handler, config)
}
Expand Down