#[repr(C)]pub struct SQLiteVfsFile {
pub io_methods: sqlite3_file,
pub vfs: *mut sqlite3_vfs,
pub flags: i32,
pub name_ptr: *const u8,
pub name_length: usize,
}
Expand description
The actual pFile type in Vfs.
szOsFile
must be set to the size of SQLiteVfsFile
.
Fields§
§io_methods: sqlite3_file
The first field must be of type sqlite_file. In C layout, the pointer to SQLiteVfsFile is the pointer to io_methods.
vfs: *mut sqlite3_vfs
The vfs where the file is located, usually used to manage files.
flags: i32
Flags used to open the database.
name_ptr: *const u8
The pointer to the file name. If it is a leaked static pointer, you need to drop it manually when xClose it.
name_length: usize
Length of the file name, on wasm32 platform, usize is u32.
Implementations§
Source§impl SQLiteVfsFile
impl SQLiteVfsFile
Sourcepub unsafe fn from_file(file: *mut sqlite3_file) -> &'static SQLiteVfsFile
pub unsafe fn from_file(file: *mut sqlite3_file) -> &'static SQLiteVfsFile
Convert a sqlite3_file
pointer to a SQLiteVfsFile
pointer.
§Safety
You must ensure that the pointer passed in is SQLiteVfsFile
Sourcepub unsafe fn name(&self) -> &'static mut str
pub unsafe fn name(&self) -> &'static mut str
Get the file name.
§Safety
When xClose, you can free the memory by drop(Box::from_raw(ptr));
.
Do not use again after free.
Sourcepub fn sqlite3_file(&'static self) -> *mut sqlite3_file
pub fn sqlite3_file(&'static self) -> *mut sqlite3_file
Convert a &'static SQLiteVfsFile
pointer to *mut sqlite3_file
pointer.