use super::{NetworkSnapshot, NetworkStatus};
#[derive(Clone, Debug)]
pub struct NetworkEvent {
pub sequence: u64,
pub generation: u64,
pub source_revision: u64,
pub snapshot: NetworkSnapshot,
pub kind: NetworkEventKind,
}
#[non_exhaustive]
#[derive(Clone, Debug)]
pub enum NetworkObservation {
Event(NetworkEvent),
Reconciled {
previous: NetworkEvent,
current: NetworkEvent,
},
}
#[non_exhaustive]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum NetworkEventKind {
Initial,
ObservationReady,
ReachabilityChanged {
previous: NetworkStatus,
current: NetworkStatus,
},
LifecycleChanged,
}
#[derive(Clone, Copy, Debug)]
pub struct NetworkEventOptions {
pub capacity: usize,
pub max_bytes: usize,
}
impl Default for NetworkEventOptions {
fn default() -> Self {
Self {
capacity: 256,
max_bytes: 256 * 1024,
}
}
}