Skip to content

Commit

Permalink
docs: documented UpdateInformer usage that doesn't create cache file
Browse files Browse the repository at this point in the history
  • Loading branch information
Enyium committed Sep 24, 2024
1 parent 74c3daf commit 66ee33f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<str>,
Expand Down Expand Up @@ -91,11 +93,11 @@ where
V: AsRef<str>,
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
///
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 66ee33f

Please sign in to comment.