use crate::error::Result;
use crate::model::{Metadata, Scope};
use crate::tags::TagEntry;
use chrono::{DateTime, Utc};
use std::collections::HashMap;
use std::path::PathBuf;
use uuid::Uuid;
pub trait StorageBackend {
fn load_index(&self, scope: Scope) -> Result<HashMap<Uuid, Metadata>>;
fn save_index(&self, scope: Scope, index: &HashMap<Uuid, Metadata>) -> Result<()>;
fn load_tags(&self, scope: Scope) -> Result<Vec<TagEntry>>;
fn save_tags(&self, scope: Scope, tags: &[TagEntry]) -> Result<()>;
fn read_content(&self, id: &Uuid, scope: Scope) -> Result<Option<String>>;
fn write_content(&self, id: &Uuid, scope: Scope, content: &str) -> Result<()>;
fn delete_content(&self, id: &Uuid, scope: Scope) -> Result<()>;
fn list_content_ids(&self, scope: Scope) -> Result<Vec<Uuid>>;
fn content_mtime(&self, id: &Uuid, scope: Scope) -> Result<Option<DateTime<Utc>>>;
fn content_path(&self, id: &Uuid, scope: Scope) -> Result<PathBuf>;
fn scope_available(&self, scope: Scope) -> bool;
}