From 66ee33f7064469ded0769fc6a92a1a8661a41c5c Mon Sep 17 00:00:00 2001 From: Enyium <123484196+Enyium@users.noreply.github.com> Date: Sun, 15 Sep 2024 07:08:31 +0200 Subject: [PATCH] docs: documented `UpdateInformer` usage that doesn't create cache file --- src/lib.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index a631bbf..d66dfb4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -36,7 +36,9 @@ pub trait Check { } } -/// Checks for a new version on Crates.io, GitHub, Npm and PyPi. +/// Checks for a new version on Crates.io, GitHub, Npm or PyPi. +/// +/// A cache file handled by the instance throttles the number of actual update checks, or you can opt in to manage this yourself. pub struct UpdateInformer< R: Registry, N: AsRef, @@ -91,11 +93,11 @@ where V: AsRef, H: HttpClient, { - /// Sets an interval how often to check for a new version. + /// Sets the interval of how often to check for a new version. /// /// # Arguments /// - /// * `interval` - An interval in seconds. By default, it is 24 hours. + /// * `interval` - The `Duration` after an actual update check during which a subsequent check will be skipped. 24 hours by default. This is implemented using a cache file. Specify `Duration::ZERO` to work without a cache file and unconditionally perform the update check. /// /// # Examples /// @@ -184,6 +186,8 @@ where { /// Checks for a new version in the registry. /// + /// In case of a non-zero [`interval()`](Self::interval), this will create or access a cache file. + /// /// # Examples /// /// To check for a new version on Crates.io: