Sync computers
This commit is contained in:
21
src/virtual_fs.rs
Normal file
21
src/virtual_fs.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use alloc::boxed::Box;
|
||||
use bffs::path::Path;
|
||||
use hashbrown::HashMap;
|
||||
|
||||
pub trait VirtualNode {
|
||||
fn read(&mut self, buf: &mut [u8]) -> Result<usize, ()>;
|
||||
}
|
||||
|
||||
pub trait VirtualFileSystem {
|
||||
fn open<'a, P: Into<Path<'a>>>(path: P) -> Result<Box<dyn VirtualNode + Send>, ()>;
|
||||
}
|
||||
|
||||
pub struct MainFileSystem {
|
||||
mounts: HashMap<PathBuf>
|
||||
}
|
||||
|
||||
impl VirtualFileSystem for MainFileSystem {
|
||||
fn open<'a, P: Into<Path<'a>>>(path: P) -> Result<Box<dyn VirtualNode + Send>, ()> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user