use std::{fmt::Debug, path::PathBuf};
use tracing::debug;
pub mod default;
pub trait Store: Send + Sync + Debug {
fn write(&self, file: Vec<u8>) -> Result<PathBuf, String>;
fn create(&self, file: Vec<u8>, dst: PathBuf) -> Result<(), String> {
let src = self.write(file)?;
debug!(
"Creating symlink {} -> {}",
dst.to_string_lossy(),
src.to_string_lossy()
);
crate::utils::create_symlink(src, dst).map_err(|e| e.to_string())?;
Ok(())
}
}