#[non_exhaustive]pub struct CreateTransactionOptions<'hint> {
pub hint: Option<&'hint str>,
pub is_read_only: bool,
}Expand description
Options for customizing a transaction. Used with Store::transaction_with_options.
let mut options = CreateTransactionOptions::new();
options.hint = Some("my transaction name");
options.is_read_only = true;
ditto
.store()
.transaction_with_options(options, async |txn| {
// do transaction stuff
Ok::<_, DittoError>(TransactionCompletionAction::Commit)
})
.await
.unwrap();Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.hint: Option<&'hint str>A hint used for debugging and logging
is_read_only: boolWhether the transaction should be created read-only
Implementations§
Source§impl CreateTransactionOptions<'_>
impl CreateTransactionOptions<'_>
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new, default CreateTransactionOptions.
Trait Implementations§
Source§impl<'hint> Clone for CreateTransactionOptions<'hint>
impl<'hint> Clone for CreateTransactionOptions<'hint>
Source§fn clone(&self) -> CreateTransactionOptions<'hint>
fn clone(&self) -> CreateTransactionOptions<'hint>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'hint> Debug for CreateTransactionOptions<'hint>
impl<'hint> Debug for CreateTransactionOptions<'hint>
Source§impl Default for CreateTransactionOptions<'_>
impl Default for CreateTransactionOptions<'_>
Source§impl<'hint> PartialEq for CreateTransactionOptions<'hint>
impl<'hint> PartialEq for CreateTransactionOptions<'hint>
Source§fn eq(&self, other: &CreateTransactionOptions<'hint>) -> bool
fn eq(&self, other: &CreateTransactionOptions<'hint>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'hint> StructuralPartialEq for CreateTransactionOptions<'hint>
Auto Trait Implementations§
impl<'hint> Freeze for CreateTransactionOptions<'hint>
impl<'hint> RefUnwindSafe for CreateTransactionOptions<'hint>
impl<'hint> Send for CreateTransactionOptions<'hint>
impl<'hint> Sync for CreateTransactionOptions<'hint>
impl<'hint> Unpin for CreateTransactionOptions<'hint>
impl<'hint> UnwindSafe for CreateTransactionOptions<'hint>
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