/// Check if it is time to ask remote server for latest updates.
///
/// It returns `true` if it has been more than [`UPDATE_INTERVAL`] seconds since we last
/// checked with server (i.e. ran [`update_ready()`]), otherwise returns false.
///
/// [`update_ready()`]: struct.Updater.html#method.update_ready
///
/// # Example
///
/// ```rust,no_run
/// # extern crate alfred_rs;
/// # extern crate failure;
/// # use alfred_rs::Updater;
/// # use failure::Error;
/// # fn run() -> Result<(), Error> {
/// let mut updater = Updater::gh("spamwax/alfred-pinboard-rs")?;
///
/// // Assuming it is has been UPDATE_INTERVAL seconds since last time we ran the
/// // `update_ready()` and there actually exists a new release:
/// assert_eq!(true, updater.due_to_check());
/// # Ok(())
/// # }
/// # fn main() {
/// # run();
/// # }
/// ```
///
/// [`UPDATE_INTERVAL`]: constant.UPDATE_INTERVAL.html
Check if it is time to ask remote server for latest updates.


Check if it is time to ask remote server for latest updates .
pub fn due_to_check(&self) -> bool {
        self.last_check().map_or(true, |dt| {
            debug!("last check: {}", dt);
            Utc::now().signed_duration_since(dt) > Duration::seconds(self.update_interval())
        })
    }
pub fn due_to_check ( & self ) -> bool { self . last_check ( ) . map_or ( true , | dt | { debug ! ( " " dt ) ; Utc :: now ( ) . signed_duration_since ( dt ) > Duration :: seconds ( self . update_interval ( ) ) } ) }
Check if it is time to ask remote server for latest updates.
Check if it is time to ask remote server for latest updates .
&self
example
None
extern crate alfred_rs;
None
extern crate failure;
None
use alfred_rs::updater;
None
use failure::error;
None
fn run() -> result<(), error> {
let mut updater = Updater::gh("spamwax/alfred-pinboard-rs")?.

Assuming it is has been UPDATE_INTERVAL seconds since last time we ran the
`update_ready()` and there actually exists a new release:
assert_eq!(true, updater.due_to_check()).
let mut updater = Updater :: gh ( " spamwax / alfred - pinboard - rs " ) ? . Assuming it is has been UPDATE_INTERVAL seconds since last time we ran the ` update_ready () ` and there actually exists a new release : assert_eq! ( true updater . due_to_check () ) .
ok(())
None
}
None
fn main() {
None
run();
None
}
None