Files
nix-js/fix/src/store.rs
T
2026-03-22 16:50:08 +08:00

40 lines
791 B
Rust

use crate::error::Result;
mod config;
mod daemon;
mod error;
mod validation;
pub use config::StoreConfig;
pub use daemon::DaemonStore;
pub trait Store: Send + Sync {
fn get_store_dir(&self) -> &str;
fn is_valid_path(&self, path: &str) -> Result<bool>;
fn ensure_path(&self, path: &str) -> Result<()>;
fn add_to_store(
&self,
name: &str,
content: &[u8],
recursive: bool,
references: Vec<String>,
) -> Result<String>;
fn add_to_store_from_path(
&self,
name: &str,
source_path: &std::path::Path,
references: Vec<String>,
) -> Result<String>;
fn add_text_to_store(
&self,
name: &str,
content: &str,
references: Vec<String>,
) -> Result<String>;
}