use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use crate::model::discovery::DiscoveryItem; use super::InstanceAuthenticated; #[derive(Clone, Hash, PartialEq, Eq, Debug, Serialize, Deserialize)] pub struct DiscoveryMessage { pub message: InstanceAuthenticated, } #[derive(Clone, Hash, PartialEq, Eq, Debug, Serialize, Deserialize)] pub enum DiscoveryMessageKind { Offer(DiscoveryOffer), Request(DiscoveryRequest), Discoveries(Discoveries), } #[derive(Clone, Hash, PartialEq, Eq, Debug, Serialize, Deserialize)] pub struct DiscoveryOffer { pub earliest: DateTime, pub hashes: Vec, } #[derive(Clone, Hash, PartialEq, Eq, Debug, Serialize, Deserialize)] pub struct DiscoveryRequest { pub since: DateTime, pub hashes: Vec, } #[derive(Clone, Hash, PartialEq, Eq, Debug, Serialize, Deserialize)] pub struct Discoveries { pub discoveries: Vec, }