#[repr(C)]pub struct Conn {
pub _ctx: *mut c_void,
pub _prepare_stmt: unsafe extern "C" fn(api: *mut Conn, sql: *const c_char) -> *mut Stmt,
pub _execute: unsafe extern "C" fn(ctx: *mut Conn, sql: *const c_char, args: *mut Value, arg_count: i32, last_insert_rowid: *mut i64) -> ResultCode,
pub _close: unsafe extern "C" fn(ctx: *mut c_void),
}Expand description
core database connection public fields for core only
Fields§
§_ctx: *mut c_void§_prepare_stmt: unsafe extern "C" fn(api: *mut Conn, sql: *const c_char) -> *mut Stmt§_execute: unsafe extern "C" fn(ctx: *mut Conn, sql: *const c_char, args: *mut Value, arg_count: i32, last_insert_rowid: *mut i64) -> ResultCode§_close: unsafe extern "C" fn(ctx: *mut c_void)Implementations§
Source§impl Conn
impl Conn
pub fn new( ctx: *mut c_void, prepare_stmt: unsafe extern "C" fn(api: *mut Conn, sql: *const c_char) -> *mut Stmt, exec_fn: unsafe extern "C" fn(ctx: *mut Conn, sql: *const c_char, args: *mut Value, arg_count: i32, last_insert_rowid: *mut i64) -> ResultCode, close: unsafe extern "C" fn(ctx: *mut c_void), ) -> Self
Sourcepub unsafe fn from_ptr(ptr: *mut Conn) -> ExtResult<&'static mut Self>
pub unsafe fn from_ptr(ptr: *mut Conn) -> ExtResult<&'static mut Self>
§Safety
Dereferences a null pointer with a null check
pub fn close(&mut self)
Sourcepub fn execute(&self, sql: &str, args: &[Value]) -> ExtResult<Option<usize>>
pub fn execute(&self, sql: &str, args: &[Value]) -> ExtResult<Option<usize>>
execute a SQL statement with the given arguments. optionally returns the last inserted rowid for the query
pub fn prepare_stmt(&self, sql: &str) -> *mut Stmt
Trait Implementations§
Auto Trait Implementations§
impl !Send for Conn
impl !Sync for Conn
impl Freeze for Conn
impl RefUnwindSafe for Conn
impl Unpin for Conn
impl UnsafeUnpin for Conn
impl UnwindSafe for Conn
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more