#[derive(Debug, Clone)]
pub struct Settings {
pub host: String,
pub ssl_enabled: bool,
pub persistence_enabled: bool,
pub cache_size_bytes: i64,
pub cache_directory: Option<std::path::PathBuf>,
}
impl Default for Settings {
fn default() -> Self {
Self {
host: "firestore.googleapis.com".to_string(),
ssl_enabled: true,
persistence_enabled: true,
cache_size_bytes: 100 * 1024 * 1024, cache_directory: None,
}
}
}
impl Settings {
pub const CACHE_SIZE_UNLIMITED: i64 = -1;
pub fn new() -> Self {
Self::default()
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Source {
Default,
Server,
Cache,
}
impl Default for Source {
fn default() -> Self {
Source::Default
}
}