pub struct Transaction { /* private fields */ }Available on crate feature
mock only.Expand description
A completed transaction recorded by a MockDatabase — the ordered list
of statements executed against it. Compare against expected SQL in tests
via Transaction::from_sql_and_values.
Implementations§
Source§impl Transaction
impl Transaction
Sourcepub fn from_sql_and_values<I, T>(
db_backend: DbBackend,
sql: T,
values: I,
) -> Self
pub fn from_sql_and_values<I, T>( db_backend: DbBackend, sql: T, values: I, ) -> Self
Get the Values from s raw SQL statement depending on the DatabaseBackend
Sourcepub fn many<I>(stmts: I) -> Selfwhere
I: IntoIterator<Item = Statement>,
pub fn many<I>(stmts: I) -> Selfwhere
I: IntoIterator<Item = Statement>,
Create a Transaction with many statements
Sourcepub fn wrap<I>(stmts: I) -> Vec<Self>where
I: IntoIterator<Item = Statement>,
pub fn wrap<I>(stmts: I) -> Vec<Self>where
I: IntoIterator<Item = Statement>,
Wrap each Statement as a single-statement Transaction
Sourcepub fn statements(&self) -> &[Statement]
pub fn statements(&self) -> &[Statement]
Get the list of statements
Trait Implementations§
Source§impl Clone for Transaction
impl Clone for Transaction
Source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Transaction
impl Debug for Transaction
Source§impl PartialEq for Transaction
impl PartialEq for Transaction
impl StructuralPartialEq for Transaction
Auto Trait Implementations§
impl Freeze for Transaction
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnsafeUnpin for Transaction
impl UnwindSafe for Transaction
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more