Feature flag vfs for fs feature/prevent wasm

This commit is contained in:
PThorpe92 2025-03-06 21:24:05 -05:00
parent 8e2c9367c0
commit 2cc72ed9ab
No known key found for this signature in database
GPG key ID: 66DB3FBACBDD05CC
5 changed files with 19 additions and 11 deletions

View file

@ -1,13 +1,16 @@
mod types;
mod vfs_modules;
pub use limbo_macros::{register_extension, scalar, AggregateDerive, VTabModuleDerive, VfsDerive};
#[cfg(not(target_family = "wasm"))]
pub use limbo_macros::VfsDerive;
pub use limbo_macros::{register_extension, scalar, AggregateDerive, VTabModuleDerive};
use std::{
fmt::Display,
os::raw::{c_char, c_void},
};
pub use types::{ResultCode, Value, ValueType};
use vfs_modules::RegisterVfsFn;
pub use vfs_modules::{VfsExtension, VfsFile, VfsFileImpl, VfsImpl};
pub use vfs_modules::{RegisterVfsFn, VfsFileImpl, VfsImpl};
#[cfg(not(target_family = "wasm"))]
pub use vfs_modules::{VfsExtension, VfsFile};
pub type ExtResult<T> = std::result::Result<T, ResultCode>;

View file

@ -21,7 +21,6 @@ pub trait VfsExtension: Default + Send + Sync {
chrono::Local::now().format("%Y-%m-%d %H:%M:%S").to_string()
}
}
#[cfg(not(target_family = "wasm"))]
pub trait VfsFile: Send + Sync {
fn lock(&mut self, _exclusive: bool) -> ExtResult<()> {