extern crate apiety; use apiety::Endpoint; fn main() { let mut endpoint = apiety::stash::public::Endpoint::new("99986044-104874503-98474553-113565984-106112382"); let mut count = 0; loop { println!("{}", endpoint.get_url()); let stashes = apiety::get_body(&endpoint).unwrap(); let stashes = apiety::stash::public::Endpoint::deserialize(stashes.as_str()); match stashes { Ok(stashes) => { // Here you would check the stash tabs and index them or whatever you want to do count += stashes.stashes.len(); println!("Got {} stash tabs this time and {} in total so far", stashes.stashes.len(), count); // create endpoint with new next_change_id endpoint = apiety::stash::public::Endpoint::new(stashes.next_change_id.as_str()); }, Err(err) => { println!("{:?}", err); break; } } } }