Impl IO trait for VfsMod type

This commit is contained in:
PThorpe92 2025-03-06 15:24:07 -05:00
parent 7d18b6b8b0
commit 8d3c44cf00
No known key found for this signature in database
GPG key ID: 66DB3FBACBDD05CC
3 changed files with 165 additions and 0 deletions

View file

@ -24,6 +24,15 @@ pub enum OpenFlags {
Create,
}
impl OpenFlags {
pub fn to_flags(&self) -> i32 {
match self {
Self::None => 0,
Self::Create => 1,
}
}
}
pub trait IO: Send + Sync {
fn open_file(&self, path: &str, flags: OpenFlags, direct: bool) -> Result<Arc<dyn File>>;
@ -203,5 +212,6 @@ cfg_block! {
}
mod memory;
mod vfs;
pub use memory::MemoryIO;
mod common;