mastodon_async/
polling_time.rs

1use derive_deref::Deref;
2use std::time::Duration;
3
4/// How long to wait before checking an endpoint again.
5#[derive(Debug, Deref, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
6pub struct PollingTime(Duration);
7
8impl Default for PollingTime {
9    fn default() -> Self {
10        Self(Duration::from_millis(500))
11    }
12}
13
14impl From<Duration> for PollingTime {
15    fn from(value: Duration) -> Self {
16        Self(value)
17    }
18}