mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 01:58:16 +00:00
Impl IO trait for VfsMod type
This commit is contained in:
parent
7d18b6b8b0
commit
8d3c44cf00
3 changed files with 165 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue