[−][src]Struct places::db::PlacesTransaction
High level transaction type which "does the right thing" for you.
Construct one with PlacesDb::begin_transaction()
.
Implementations
impl<'conn> PlacesTransaction<'conn>
[src]
pub fn should_commit(&self) -> bool
[src]
Returns true
if the current transaction should be committed at the
earliest opportunity.
pub fn maybe_commit(&mut self) -> Result<()>
[src]
- For transactions on sync connnections: Checks to see if we have held a transaction for longer than the requested time, and if so, commits the current transaction and opens another.
- For transactions on other connections:
debug_assert!
s, or logs a warning and does nothing.
pub fn commit(self) -> Result<()>
[src]
Consumes and commits a PlacesTransaction transaction.
pub fn rollback(self) -> Result<()>
[src]
Consumes and attempst to roll back a PlacesTransaction. Note that if maybe_commit has been called, this may only roll back as far as that call.
Trait Implementations
impl<'conn> ConnExt for PlacesTransaction<'conn>
[src]
fn conn(&self) -> &Connection
[src]
fn set_pragma<T>(
&self,
pragma_name: &str,
pragma_value: T
) -> Result<&Self, Error> where
T: ToSql,
[src]
&self,
pragma_name: &str,
pragma_value: T
) -> Result<&Self, Error> where
T: ToSql,
fn prepare_maybe_cached(
&'conn self,
sql: &str,
cache: bool
) -> Result<MaybeCached<'conn>, Error>
[src]
&'conn self,
sql: &str,
cache: bool
) -> Result<MaybeCached<'conn>, Error>
fn execute_all(&self, stmts: &[&str]) -> Result<(), Error>
[src]
fn execute_cached<P>(&self, sql: &str, params: P) -> Result<usize, Error> where
P: IntoIterator,
<P as IntoIterator>::Item: ToSql,
[src]
P: IntoIterator,
<P as IntoIterator>::Item: ToSql,
fn execute_named_cached(
&self,
sql: &str,
params: &[(&str, &dyn ToSql)]
) -> Result<usize, Error>
[src]
&self,
sql: &str,
params: &[(&str, &dyn ToSql)]
) -> Result<usize, Error>
fn query_one<T>(&self, sql: &str) -> Result<T, Error> where
T: FromSql,
[src]
T: FromSql,
fn try_query_one<T>(
&self,
sql: &str,
params: &[(&str, &dyn ToSql)],
cache: bool
) -> Result<Option<T>, Error> where
T: FromSql,
[src]
&self,
sql: &str,
params: &[(&str, &dyn ToSql)],
cache: bool
) -> Result<Option<T>, Error> where
T: FromSql,
fn query_row_and_then_named<T, E, F>(
&self,
sql: &str,
params: &[(&str, &dyn ToSql)],
mapper: F,
cache: bool
) -> Result<T, E> where
E: From<Error>,
F: FnOnce(&Row<'_>) -> Result<T, E>,
[src]
&self,
sql: &str,
params: &[(&str, &dyn ToSql)],
mapper: F,
cache: bool
) -> Result<T, E> where
E: From<Error>,
F: FnOnce(&Row<'_>) -> Result<T, E>,
fn query_rows_and_then_named<T, E, F>(
&self,
sql: &str,
params: &[(&str, &dyn ToSql)],
mapper: F
) -> Result<Vec<T>, E> where
E: From<Error>,
F: FnMut(&Row<'_>) -> Result<T, E>,
[src]
&self,
sql: &str,
params: &[(&str, &dyn ToSql)],
mapper: F
) -> Result<Vec<T>, E> where
E: From<Error>,
F: FnMut(&Row<'_>) -> Result<T, E>,
fn query_rows_and_then_named_cached<T, E, F>(
&self,
sql: &str,
params: &[(&str, &dyn ToSql)],
mapper: F
) -> Result<Vec<T>, E> where
E: From<Error>,
F: FnMut(&Row<'_>) -> Result<T, E>,
[src]
&self,
sql: &str,
params: &[(&str, &dyn ToSql)],
mapper: F
) -> Result<Vec<T>, E> where
E: From<Error>,
F: FnMut(&Row<'_>) -> Result<T, E>,
fn query_rows_into<Coll, T, E, F>(
&self,
sql: &str,
params: &[(&str, &dyn ToSql)],
mapper: F
) -> Result<Coll, E> where
Coll: FromIterator<T>,
E: From<Error>,
F: FnMut(&Row<'_>) -> Result<T, E>,
[src]
&self,
sql: &str,
params: &[(&str, &dyn ToSql)],
mapper: F
) -> Result<Coll, E> where
Coll: FromIterator<T>,
E: From<Error>,
F: FnMut(&Row<'_>) -> Result<T, E>,
fn query_rows_into_cached<Coll, T, E, F>(
&self,
sql: &str,
params: &[(&str, &dyn ToSql)],
mapper: F
) -> Result<Coll, E> where
Coll: FromIterator<T>,
E: From<Error>,
F: FnMut(&Row<'_>) -> Result<T, E>,
[src]
&self,
sql: &str,
params: &[(&str, &dyn ToSql)],
mapper: F
) -> Result<Coll, E> where
Coll: FromIterator<T>,
E: From<Error>,
F: FnMut(&Row<'_>) -> Result<T, E>,
fn try_query_row<T, E, F>(
&self,
sql: &str,
params: &[(&str, &dyn ToSql)],
mapper: F,
cache: bool
) -> Result<Option<T>, E> where
E: From<Error>,
F: FnOnce(&Row<'_>) -> Result<T, E>,
[src]
&self,
sql: &str,
params: &[(&str, &dyn ToSql)],
mapper: F,
cache: bool
) -> Result<Option<T>, E> where
E: From<Error>,
F: FnOnce(&Row<'_>) -> Result<T, E>,
fn unchecked_transaction(&self) -> Result<UncheckedTransaction<'_>, Error>
[src]
fn unchecked_transaction_imm(&self) -> Result<UncheckedTransaction<'_>, Error>
[src]
impl<'conn> Deref for PlacesTransaction<'conn>
[src]
Auto Trait Implementations
impl<'conn> !RefUnwindSafe for PlacesTransaction<'conn>
impl<'conn> !Send for PlacesTransaction<'conn>
impl<'conn> !Sync for PlacesTransaction<'conn>
impl<'conn> Unpin for PlacesTransaction<'conn>
impl<'conn> !UnwindSafe for PlacesTransaction<'conn>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,