Skip to main content

04_storefront_current/
04_storefront_current.rs

1use std::time::Duration;
2
3use storekit::Storefront;
4
5fn main() -> Result<(), Box<dyn std::error::Error>> {
6    println!("current storefront: {:?}", Storefront::current());
7    match Storefront::updates() {
8        Ok(mut updates) => println!(
9            "storefront update within timeout: {:?}",
10            updates.next_timeout(Duration::from_millis(100))?
11        ),
12        Err(error) => println!("storefront updates unavailable: {error}"),
13    }
14    Ok(())
15}