Sync computers

This commit is contained in:
2026-03-01 16:12:02 +01:00
parent 392af94345
commit 041e544330
7 changed files with 59 additions and 41 deletions

View File

@@ -1,5 +1,5 @@
use alloc::boxed::Box;
use bffs::path::Path;
use bffs::path::{Path, PathBuf};
use hashbrown::HashMap;
pub trait VirtualNode {
@@ -7,15 +7,18 @@ pub trait VirtualNode {
}
pub trait VirtualFileSystem {
fn open<'a, P: Into<Path<'a>>>(path: P) -> Result<Box<dyn VirtualNode + Send>, ()>;
fn open(&mut self, path: &Path) -> Result<Box<dyn VirtualNode + Send>, ()>;
}
pub struct MainFileSystem {
mounts: HashMap<PathBuf>
mounts: HashMap<PathBuf, Box<dyn VirtualFileSystem>>,
}
impl VirtualFileSystem for MainFileSystem {
fn open<'a, P: Into<Path<'a>>>(path: P) -> Result<Box<dyn VirtualNode + Send>, ()> {
fn open(&mut self, path: &Path) -> Result<Box<dyn VirtualNode + Send>, ()> {
for mount in self.mounts.iter() {
}
todo!()
}
}