pub mod fs;
use std::path::Path;
use std::time::SystemTime;
use crate::error::GettextError;
pub use fs::{cleanup_orphan_tmps, FsFileStore};
pub trait FileStore: Send + Sync {
fn read(&self, path: &Path) -> Result<String, GettextError>;
fn write(&self, path: &Path, content: &str) -> Result<(), GettextError>;
fn write_bytes(&self, path: &Path, bytes: &[u8]) -> Result<(), GettextError> {
let s = std::str::from_utf8(bytes).map_err(|e| {
GettextError::InvalidInput(format!("write_bytes default impl expects UTF-8: {e}"))
})?;
self.write(path, s)
}
fn modified_time(&self, path: &Path) -> Result<SystemTime, GettextError>;
fn exists(&self, path: &Path) -> bool;
}