pub struct FakeUpdateInformer<V: AsRef<str>> { /* private fields */ }
Expand description

Fake UpdateInformer. Used only for tests.

Implementations§

👎Deprecated since 0.5.0: Use update_informer::fake instead

Constructs a new FakeUpdateInformer.

Arguments
  • registry - A registry service such as Crates.io or GitHub (not used).
  • name - A project name (not used).
  • version - Current version of the project (not used).
  • interval - An interval how often to check for a new version (not used).
  • new_version - A desired version.
Examples
use update_informer::{registry, Check, FakeUpdateInformer};

let informer = FakeUpdateInformer::new(registry::Crates, "repo", "0.1.0", "1.0.0");

Returns FakeUpdateInformer.

Returns FakeUpdateInformer.

Trait Implementations§

Returns the desired version as a new version.

Examples
use update_informer::{registry, Check};

let informer = update_informer::fake(registry::Crates, "crate_name", "0.1.0", "1.0.0");
let result = informer.check_version();
assert!(result.is_ok());

let version = result.unwrap();
assert!(version.is_some());
assert_eq!(version.unwrap().to_string(), "v1.0.0");

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 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.