Sync computers
This commit is contained in:
@@ -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!()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user