2026-03-24 13:40:35 +00:00

15 lines
517 B
Rust

use crate::fs::{FsEntry, FsError};
pub trait FsBackend: Send + Sync {
fn mount(&mut self) -> Result<(), FsError>;
fn unmount(&mut self);
fn list_dir(&self, path: &str) -> Result<Vec<FsEntry>, FsError>;
fn read_file(&self, path: &str) -> Result<Vec<u8>, FsError>;
fn write_file(&mut self, path: &str, data: &[u8]) -> Result<(), FsError>;
fn delete(&mut self, path: &str) -> Result<(), FsError>;
fn exists(&self, path: &str) -> bool;
fn is_healthy(&self) -> bool {
true
}
}