Struct sqlite::ConnectionThreadSafe

source ·
pub struct ConnectionThreadSafe(/* private fields */);
Expand description

A thread-safe connection.

Methods from Deref<Target = Connection>§

source

pub fn execute<T: AsRef<str>>(&self, statement: T) -> Result<()>

Execute a statement without processing the resulting rows if any.

source

pub fn iterate<T: AsRef<str>, F>(&self, statement: T, callback: F) -> Result<()>
where F: FnMut(&[(&str, Option<&str>)]) -> bool,

Execute a statement and process the resulting rows as plain text.

The callback is triggered for each row. If the callback returns false, no more rows will be processed. For large queries and non-string data types, prepared statement are highly preferable; see prepare.

source

pub fn prepare<T: AsRef<str>>(&self, statement: T) -> Result<Statement<'_>>

Create a prepared statement.

source

pub fn set_busy_handler<F>(&mut self, callback: F) -> Result<()>
where F: FnMut(usize) -> bool + Send + 'static,

Set a callback for handling busy events.

The callback is triggered when the database cannot perform an operation due to processing of some other request. If the callback returns true, the operation will be repeated.

source

pub fn set_busy_timeout(&mut self, milliseconds: usize) -> Result<()>

Set an implicit callback for handling busy events that tries to repeat rejected operations until a timeout expires.

source

pub fn remove_busy_handler(&mut self) -> Result<()>

Remove the callback handling busy events.

source

pub fn change_count(&self) -> usize

Return the number of rows inserted, updated, or deleted by the most recent INSERT, UPDATE, or DELETE statement.

source

pub fn total_change_count(&self) -> usize

Return the total number of rows inserted, updated, and deleted by all INSERT, UPDATE, and DELETE statements since the connection was opened.

Trait Implementations§

source§

impl Deref for ConnectionThreadSafe

§

type Target = Connection

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for ConnectionThreadSafe

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Sync for ConnectionThreadSafe

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>,

§

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>,

§

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.