Struct SQLiteVfsFile

Source
#[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

Source

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

Source

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.

Source

pub fn sqlite3_file(&'static self) -> *mut sqlite3_file

Convert a &'static SQLiteVfsFile pointer to *mut sqlite3_file pointer.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.