fn status_json(client: &mut RpmOstreeClient) -> Result<Rc<StatusJson>> {
    STATUS_CACHE_ATTEMPTS.inc();
    let ostree_depls_data = fs::metadata(OSTREE_DEPLS_PATH)
        .with_context(|| format!("failed to query directory {}", OSTREE_DEPLS_PATH))?;
    let ostree_depls_data_mtime = FileTime::from_last_modification_time(&ostree_depls_data);

    if let Some(cache) = &client.status_cache {
        if cache.mtime == ostree_depls_data_mtime {
            trace!("status cache is up to date");
            return Ok(cache.status.clone());
        }
    }

    STATUS_CACHE_MISSES.inc();
    trace!("cache stale, invoking rpm-ostree to retrieve local deployments");
    let status = Rc::new(invoke_cli_status(false)?);
    client.status_cache = Some(StatusCache {
        status: Rc::clone(&status),
        mtime: ostree_depls_data_mtime,
    });

    Ok(status)
}
/// Ensure our status cache is up to date; if empty or out of date, run `rpm-ostree status` to populate it.
Ensure our status cache is up to date; if empty or out of date, run `rpm-ostree status` to populate it.
Ensure our status cache is up to date ; if empty or out of date run ` rpm - ostree status ` to populate it .
fn status_json(client: &mut RpmOstreeClient) -> Result<Rc<StatusJson>> {
    STATUS_CACHE_ATTEMPTS.inc();
    let ostree_depls_data = fs::metadata(OSTREE_DEPLS_PATH)
        .with_context(|| format!("failed to query directory {}", OSTREE_DEPLS_PATH))?;
    let ostree_depls_data_mtime = FileTime::from_last_modification_time(&ostree_depls_data);
    if let Some(cache) = &client.status_cache {
        if cache.mtime == ostree_depls_data_mtime {
            trace!("status cache is up to date");
            return Ok(cache.status.clone());
        }
    }
    STATUS_CACHE_MISSES.inc();
    trace!("cache stale, invoking rpm-ostree to retrieve local deployments");
    let status = Rc::new(invoke_cli_status(false)?);
    client.status_cache = Some(StatusCache {
        status: Rc::clone(&status),
        mtime: ostree_depls_data_mtime,
    });
    Ok(status)
}
fn status_json ( client : & mut RpmOstreeClient ) -> Result < Rc < StatusJson > > { STATUS_CACHE_ATTEMPTS . inc ( ) ; let ostree_depls_data = fs :: metadata ( OSTREE_DEPLS_PATH ) . with_context ( | | format ! ( " " OSTREE_DEPLS_PATH ) ) ? ; let ostree_depls_data_mtime = FileTime :: from_last_modification_time ( & ostree_depls_data ) ; if let Some ( cache ) = & client . status_cache { if cache . mtime == ostree_depls_data_mtime { trace ! ( " " ) ; return Ok ( cache . status . clone ( ) ) ; } } STATUS_CACHE_MISSES . inc ( ) ; trace ! ( " " ) ; let status = Rc :: new ( invoke_cli_status ( false ) ? ) ; client . status_cache = Some ( StatusCache { status : Rc :: clone ( & status ) , mtime : ostree_depls_data_mtime , } ) ; Ok ( status ) }
Ensure our status cache is up to date; if empty or out of date, run `rpm-ostree status` to populate it.
Ensure our status cache is up to date ; if empty or out of date run ` rpm - ostree status ` to populate it .
client
&mut RpmOstreeClient