//! What a device holds beside the database it is in, and how a copy leaves//! it: the held replicas on disk ([`held`]), a leave, an erase and a copy out//! of scope ([`leave`]), the thirty-day Bin ([`bin`]) — and the two halves of//! the flavor rule the signed transport asks of an origin before it signs//! anything there (`SignedHttp::confirm_app`): the relay name an origin//! reaches ([`address`]) and which app its `/health` says it is//! ([`server_flavor_of`]).pubmod address;/// What else this device holds on disk.pubmod held;pubmod leave;pubuse address::{origin_refusal, relay_name_reached};pubuse held::{held_workspaces, HeldWorkspace};pubuse leave::{erase_device, leave_server, Erased, Left};/// What a `/health` ANSWER says about which app the server is: `Ok(None)` for/// a server that answered and said nothing (the frozen real one), and `Err`/// for one that did not answer at all — a relay's `502` while the Mac behind/// it is asleep is not a server saying it is CottonDB, and reading it as one/// would tell a person the wrong thing about their own household.pubfn server_flavor_of( health: &crate::transport::ClientAnswer,) -> Result<Option<String>, crate::transport::ServerRefusal> {if !(200..300).contains(&health.status) {returnErr(crate::transport::ServerRefusal::new( cotton_core::rules::sync_state::silence_words("The Mac"), health.status, )); }Ok(declared_flavor(&health.body))}/// The `flavor` a `/health` body declares, or `None` when it says none — an/// older server, which is the frozen real one, or a body that is not JSON.pubfn declared_flavor(body: &[u8]) -> Option<String> {let value: serde_json::Value = serde_json::from_slice(body).ok()?; value.get("flavor")?.as_str().map(str::to_string)}#[cfg(test)]#[path = "join_tests.rs"]mod tests;/// The shared purge path for expired database copies.pubmod bin;