use std::time::Duration;
use crate::bin_types::*;
use dht_arc::{DhtArc, DhtLocation};
use super::*;
pub struct PublishedData {
pub agent: Arc<KitsuneAgent>,
pub storage_arc: DhtArc,
pub published_hashes: Vec<(DhtLocation, KitsuneOpHash)>,
}
pub struct ConsistencySession {
pub keep_alive: Option<Duration>,
pub frequency: Duration,
pub timeout: Duration,
pub expected_data: ExpectedData,
}
pub struct ExpectedData {
pub expected_agents: Vec<Arc<KitsuneAgent>>,
pub expected_hashes: Vec<KitsuneOpHash>,
}
pub struct SessionMessage {
pub from: Arc<KitsuneAgent>,
pub report: SessionReport,
}
pub enum SessionReport {
KeepAlive {
missing_agents: u32,
expected_agents: u32,
missing_hashes: u32,
expected_hashes: u32,
},
Complete {
elapsed_ms: u32,
},
Timeout {
missing_agents: Vec<Arc<KitsuneAgent>>,
missing_hashes: Vec<KitsuneOpHash>,
},
Error {
error: String,
},
}