Expand description
Utility functions and types to help with creating custom VFS implementations. Low-level utilities, traits, and macros for implementing custom SQLite Virtual File Systems (VFS).
Modules§
- x_
methods_ shim - A module containing shims for VFS methods that are implemented using JavaScript interoperability.
Macros§
- bail
- A macro to return a specific SQLite error code if a condition is true.
- check_
option - A macro to safely unwrap an
Option<T>, returning a SQLite error code onNone. - check_
result - A macro to safely unwrap a
Result<T, E>, returning a SQLite error code onErr. - unused
- A macro to explicitly mark a parameter as unused, suppressing compiler warnings.
Structs§
- Lazy
Cell - A wrapper around
once_cell::unsync::Lazythat providesSendandSynctrait implementations when theatomicstarget feature is not enabled, allowing for thread-local static initialization. - MemChunks
File - An in-memory file implementation that stores data in fixed-size chunks. Suitable for temporary files.
- SQLite
VfsFile - The core file-handle structure for a custom VFS, designed to be compatible with SQLite’s C interface.
- VfsApp
Data - A wrapper for the
pAppDatapointer insqlite3_vfs, providing a safe way to manage VFS-specific application data and error states. - VfsError
- A container for VFS-specific errors, holding both an error code and a descriptive message.
Enums§
- Import
DbError - Register
VfsError - Represents errors that can occur during the VFS registration process.
Constants§
- SQLIT
E3_ HEADER - The header of the SQLite file is used to determine whether the imported file is legal.
Traits§
- SQLite
IoMethods - A trait that abstracts the
sqlite3_io_methodsstruct, allowing for a more idiomatic Rust implementation. - SQLite
Vfs - A trait that abstracts the
sqlite3_vfsstruct, allowing for a more idiomatic Rust implementation. - VfsFile
- A trait defining the basic I/O capabilities required for a VFS file implementation.
- VfsStore
- Make changes to files
Functions§
- check_
db_ and_ page_ size - Check db and page size, page size must be a power of two between 512 and 65536 inclusive, db size must be a multiple of page size.
- check_
import_ db - Simple verification when importing db, and return page size;
- random_
name - Generates a random, temporary filename, typically used when SQLite requests a file with a NULL name.
- register_
vfs - A generic function to register a custom VFS implementation with SQLite.
- registered_
vfs - Checks if a VFS with the given name is already registered with SQLite and returns a pointer to it if found.
Type Aliases§
- VfsResult
- A specialized
Resulttype for VFS operations.