pub mod acme; pub mod checker; mod config; pub mod manager; mod name; pub mod store; pub use config::*; pub use name::*; use crate::error::unexpected::{self, Mappable}; use crate::origin; use hex::ToHex; use serde::{Deserialize, Serialize}; use sha2::{Digest, Sha256}; #[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] /// Defines how a domain will behave when it is accessed. These are configured by the owner of the /// domain during setup. pub struct Settings { #[serde(flatten)] pub origin_descr: origin::Descr, } impl Settings { pub fn hash(&self) -> Result { let mut h = Sha256::new(); serde_json::to_writer(&mut h, self).or_unexpected()?; Ok(h.finalize().encode_hex::()) } }