mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-06 01:34:21 +01:00
Add demo vfs module to vtab kvstore
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
mod types;
|
||||
mod vfs_modules;
|
||||
pub use limbo_macros::{register_extension, scalar, AggregateDerive, VTabModuleDerive};
|
||||
pub use limbo_macros::{register_extension, scalar, AggregateDerive, VTabModuleDerive, VfsDerive};
|
||||
use std::{
|
||||
fmt::Display,
|
||||
os::raw::{c_char, c_void},
|
||||
};
|
||||
pub use types::{ResultCode, Value, ValueType};
|
||||
use vfs_modules::RegisterVfsFn;
|
||||
pub use vfs_modules::{VfsFileImpl, VfsImpl};
|
||||
pub use vfs_modules::{VfsExtension, VfsFile, VfsFileImpl, VfsImpl};
|
||||
|
||||
pub type ExtResult<T> = std::result::Result<T, ResultCode>;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ use crate::{ExtResult, ResultCode};
|
||||
use std::ffi::{c_char, c_void};
|
||||
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
pub trait VfsExtension: Default {
|
||||
pub trait VfsExtension: Default + Send + Sync {
|
||||
const NAME: &'static str;
|
||||
type File: VfsFile;
|
||||
fn open_file(&self, path: &str, flags: i32, direct: bool) -> ExtResult<Self::File>;
|
||||
@@ -23,7 +23,7 @@ pub trait VfsExtension: Default {
|
||||
}
|
||||
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
pub trait VfsFile: Sized {
|
||||
pub trait VfsFile: Send + Sync {
|
||||
fn lock(&mut self, _exclusive: bool) -> ExtResult<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user