Skip to main content

ManagedConnection

Struct ManagedConnection 

Source
pub struct ManagedConnection {
    pub db: *mut sqlite3,
}

Fields§

§db: *mut sqlite3

Trait Implementations§

Source§

impl Connection for ManagedConnection

Source§

fn create_function_v2( &self, name: &str, n_arg: i32, flags: u32, user_data: Option<*mut c_void>, func: Option<xFunc>, step: Option<xStep>, final_func: Option<xFinal>, destroy: Option<xDestroy>, ) -> Result<ResultCode, ResultCode>

TODO: create_function is infrequent enough that we can pay the cost of the copy rather than take a c_char

Source§

fn changes64(&self) -> i64

Source§

fn commit_hook( &self, callback: Option<xCommitHook>, user_data: *mut c_void, ) -> *mut c_void

Source§

fn set_authorizer( &self, x_auth: Option<XAuthorizer>, user_data: *mut c_void, ) -> Result<ResultCode, ResultCode>

Source§

fn create_module_v2( &self, name: &str, module: *const module, user_data: Option<*mut c_void>, destroy: Option<xDestroy>, ) -> Result<ResultCode, ResultCode>

Source§

fn next_stmt(&self, s: Option<*mut stmt>) -> Option<*mut stmt>

Source§

fn prepare_v2(&self, sql: &str) -> Result<ManagedStmt, ResultCode>

Source§

fn prepare_v3(&self, sql: &str, flags: u32) -> Result<ManagedStmt, ResultCode>

Source§

unsafe fn exec(&self, sql: *const c_char) -> Result<ResultCode, ResultCode>

sql should be a null terminated string! However you find is most efficient to craft those, hence why we have no opinion on &str vs String vs CString vs whatever todo: we should make some sort of opaque type to force null termination this is inehritly unsafe
Source§

fn exec_safe(&self, sql: &str) -> Result<ResultCode, ResultCode>

Source§

fn errmsg(&self) -> Result<String, IntoStringError>

Source§

fn errcode(&self) -> ResultCode

Source§

fn error_offset(&self) -> Option<usize>

Source§

fn get_autocommit(&self) -> bool

Source§

fn rollback_hook( &self, callback: Option<xRollbackHook>, ctx: *mut c_void, ) -> *mut c_void

Source§

fn update_hook( &self, callback: Option<xUpdateHook>, ctx: *mut c_void, ) -> *mut c_void

Source§

impl Drop for ManagedConnection

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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.