Skip to main content

SQLiteMapTransaction

Struct SQLiteMapTransaction 

Source
pub struct SQLiteMapTransaction<'a, K, V>
where K: Type, V: Type,
{ /* private fields */ }
Expand description

Represents an active SQLite transaction for a SQLiteMap.

Most functions provided by this struct mirror the corresponding functions of the SQLiteMap struct.

The transaction is committed when the SQLiteMapTransaction is dropped.

Implementations§

Source§

impl<'a, K, V> SQLiteMapTransaction<'a, K, V>
where K: Type, V: Type,

Source

pub fn commit(self)

Drops the SQLiteMapTransaction, thereby committing the SQLite transaction.

Source

pub fn insert<Q, R>(&mut self, key: &Q, value: &R) -> Result<bool, Error>
where K: Borrow<Q>, Q: ?Sized + ToSql, V: Borrow<R>, R: ?Sized + ToSql,

This function is equivalent to SQLiteMap::insert().

Source

pub fn update<Q, R>(&mut self, key: &Q, value: &R) -> Result<(), Error>
where K: Borrow<Q>, Q: ?Sized + ToSql, V: Borrow<R>, R: ?Sized + ToSql,

This function is equivalent to SQLiteMap::update().

Source

pub fn contains_key<Q>(&self, key: &Q) -> Result<bool, Error>
where K: Borrow<Q>, Q: ?Sized + ToSql,

This function is equivalent to SQLiteMap::contains_key().

Source

pub fn contains_key_nocase<Q>(&self, key: &Q) -> Result<bool, Error>
where K: Borrow<Q> + CharType, Q: ?Sized + ToSql,

This function is equivalent to SQLiteMap::contains_key_nocase().

Source

pub fn get<Q>(&self, key: &Q) -> Result<Option<V>, Error>
where K: Borrow<Q>, Q: ?Sized + ToSql,

This function is equivalent to SQLiteMap::get().

Source

pub fn get_nocase<Q>(&self, key: &Q) -> Result<Option<V>, Error>
where K: Borrow<Q> + CharType, Q: ?Sized + ToSql,

This function is equivalent to SQLiteMap::get_nocase().

Source

pub fn remove<Q>(&mut self, key: &Q) -> Result<bool, Error>
where K: Borrow<Q>, Q: ?Sized + ToSql,

This function is equivalent to SQLiteMap::remove().

Source

pub fn remove_nocase<Q>(&mut self, key: &Q) -> Result<bool, Error>
where K: Borrow<Q> + CharType, Q: ?Sized + ToSql,

This function is equivalent to SQLiteMap::remove_nocase().

Source

pub fn for_each_key<F>(&self, callback: F) -> Result<(), Error>
where F: FnMut(K),

This function is equivalent to SQLiteMap::for_each_key().

Source

pub fn for_each_entry<F>(&self, callback: F) -> Result<(), Error>
where F: FnMut(K, V),

This function is equivalent to SQLiteMap::for_each_entry().

Source

pub fn find_key<P>(&self, predicate: P) -> Result<Option<K>, Error>
where P: Fn(&K) -> bool,

This function is equivalent to SQLiteMap::find_key().

Source

pub fn find_entry<P>(&self, predicate: P) -> Result<Option<(K, V)>, Error>
where P: Fn(&K, &V) -> bool,

This function is equivalent to SQLiteMap::find_entry().

Source

pub fn filter_keys<F, Q>(&self, pattern: &Q, callback: F) -> Result<(), Error>
where F: FnMut(K), K: Borrow<Q> + CharType, Q: ?Sized + ToSql,

This function is equivalent to SQLiteMap::filter_keys().

Source

pub fn filter_entries<F, Q>( &self, pattern: &Q, callback: F, ) -> Result<(), Error>
where F: FnMut(K, V), K: Borrow<Q> + CharType, Q: ?Sized + ToSql,

This function is equivalent to SQLiteMap::filter_entries().

Source

pub fn len(&self) -> Result<Size, Error>

This function is equivalent to SQLiteMap::len().

Source

pub fn is_empty(&self) -> Result<bool, Error>

This function is equivalent to SQLiteMap::is_empty().

Source

pub fn clear(&mut self) -> Result<(), Error>

This function is equivalent to SQLiteMap::clear().

Auto Trait Implementations§

§

impl<'a, K, V> !RefUnwindSafe for SQLiteMapTransaction<'a, K, V>

§

impl<'a, K, V> !Send for SQLiteMapTransaction<'a, K, V>

§

impl<'a, K, V> !Sync for SQLiteMapTransaction<'a, K, V>

§

impl<'a, K, V> !UnwindSafe for SQLiteMapTransaction<'a, K, V>

§

impl<'a, K, V> Freeze for SQLiteMapTransaction<'a, K, V>
where (PhantomData<K>, PhantomData<V>): Freeze,

§

impl<'a, K, V> Unpin for SQLiteMapTransaction<'a, K, V>
where (PhantomData<K>, PhantomData<V>): Unpin,

§

impl<'a, K, V> UnsafeUnpin for SQLiteMapTransaction<'a, K, V>

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.