Something went wrong. Try again.
Live STIB-MIVB departures on the Pebble Time 2. It covers the bus, tram, and metro network of Brussels
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031use crate::quota::Quota;use crate::storage::Store;use std::sync::Arc;
pub struct AppState { pub store: Store, pub irail_http: reqwest::Client, pub irail_quota: Arc<Quota>, pub villo_quota: Arc<Quota>, pub train_refresh: tokio::sync::mpsc::Sender<Vec<String>>,}
impl AppState { pub fn new( store: Store, train_refresh: tokio::sync::mpsc::Sender<Vec<String>>, ) -> Arc<Self> { Arc::new(Self { store, irail_http: reqwest::Client::builder() .user_agent("stibble (git.devtechnica.com/pebbletechnica/stibble)") .timeout(std::time::Duration::from_secs(10)) .build() .expect("irail http client"), irail_quota: Arc::new(Quota::new(180, 5000)), villo_quota: Arc::new(Quota::new(10, 5000)), train_refresh, }) }}