use crate::error::LagoResult;
use crate::id::BlobHash;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ManifestEntry {
pub path: String,
pub blob_hash: BlobHash,
pub size_bytes: u64,
pub content_type: Option<String>,
pub updated_at: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FileStat {
pub path: String,
pub size_bytes: u64,
pub content_type: Option<String>,
pub updated_at: u64,
pub blob_hash: BlobHash,
}
#[allow(async_fn_in_trait)]
pub trait Mount: Send + Sync {
async fn read(&self, path: &str) -> LagoResult<Vec<u8>>;
async fn write(&self, path: &str, data: &[u8]) -> LagoResult<BlobHash>;
async fn delete(&self, path: &str) -> LagoResult<()>;
async fn list(&self, path: &str) -> LagoResult<Vec<ManifestEntry>>;
async fn exists(&self, path: &str) -> LagoResult<bool>;
async fn stat(&self, path: &str) -> LagoResult<Option<FileStat>>;
}