pub struct Transaction { /* private fields */ }Implementations§
Source§impl Transaction
impl Transaction
Source§impl Transaction
impl Transaction
Sourcepub fn new(
local: bool,
sequences: Sequences,
async_event_trigger: Arc<Notify>,
tr: Transactor,
) -> Transaction
pub fn new( local: bool, sequences: Sequences, async_event_trigger: Arc<Notify>, tr: Transactor, ) -> Transaction
Create a new query store
Sourcepub fn enclose(self) -> Arc<Transaction>
pub fn enclose(self) -> Arc<Transaction>
Enclose this transaction in an Arc
Sourcepub fn closed(&self) -> bool
pub fn closed(&self) -> bool
Check if the transaction is finished.
If the transaction has been cancelled or committed,
then this function will return true, and any further
calls to functions on this transaction will result
in a crate::kvs::Error::TransactionFinished error.
Sourcepub async fn cancel(&self) -> Result<(), Error>
pub async fn cancel(&self) -> Result<(), Error>
Cancel a transaction.
This reverses all changes made within the transaction.
Sourcepub async fn commit(&self) -> Result<(), Error>
pub async fn commit(&self) -> Result<(), Error>
Commit a transaction.
This attempts to commit all changes made within the transaction.
Sourcepub async fn exists<K>(
&self,
key: &K,
version: Option<u64>,
) -> Result<bool, Error>where
K: KVKey + Debug,
pub async fn exists<K>(
&self,
key: &K,
version: Option<u64>,
) -> Result<bool, Error>where
K: KVKey + Debug,
Check if a key exists in the datastore.
Sourcepub async fn get<K>(
&self,
key: &K,
version: Option<u64>,
) -> Result<Option<<K as KVKey>::ValueType>, Error>where
K: KVKey + Debug,
pub async fn get<K>(
&self,
key: &K,
version: Option<u64>,
) -> Result<Option<<K as KVKey>::ValueType>, Error>where
K: KVKey + Debug,
Fetch a key from the datastore.
Sourcepub async fn getm<K>(
&self,
keys: Vec<K>,
version: Option<u64>,
) -> Result<Vec<Option<<K as KVKey>::ValueType>>, Error>where
K: KVKey + Debug,
pub async fn getm<K>(
&self,
keys: Vec<K>,
version: Option<u64>,
) -> Result<Vec<Option<<K as KVKey>::ValueType>>, Error>where
K: KVKey + Debug,
Retrieve a batch set of keys from the datastore.
Sourcepub async fn getp<K>(
&self,
key: &K,
) -> Result<Vec<(Vec<u8>, <K as KVKey>::ValueType)>, Error>where
K: KVKey + Debug,
pub async fn getp<K>(
&self,
key: &K,
) -> Result<Vec<(Vec<u8>, <K as KVKey>::ValueType)>, Error>where
K: KVKey + Debug,
Retrieve a specific prefix of keys from the datastore.
This function fetches key-value pairs from the underlying datastore in grouped batches.
Sourcepub async fn getr<K>(
&self,
rng: Range<K>,
version: Option<u64>,
) -> Result<Vec<(Vec<u8>, <K as KVKey>::ValueType)>, Error>where
K: KVKey + Debug,
pub async fn getr<K>(
&self,
rng: Range<K>,
version: Option<u64>,
) -> Result<Vec<(Vec<u8>, <K as KVKey>::ValueType)>, Error>where
K: KVKey + Debug,
Retrieve a specific range of keys from the datastore.
This function fetches key-value pairs from the underlying datastore in grouped batches.
Sourcepub async fn del<K>(&self, key: &K) -> Result<(), Error>where
K: KVKey + Debug,
pub async fn del<K>(&self, key: &K) -> Result<(), Error>where
K: KVKey + Debug,
Delete a key from the datastore.
Sourcepub async fn delc<K>(
&self,
key: &K,
chk: Option<&<K as KVKey>::ValueType>,
) -> Result<(), Error>where
K: KVKey + Debug,
pub async fn delc<K>(
&self,
key: &K,
chk: Option<&<K as KVKey>::ValueType>,
) -> Result<(), Error>where
K: KVKey + Debug,
Delete a key from the datastore if the current value matches a condition.
Sourcepub async fn delr<K>(&self, rng: Range<K>) -> Result<(), Error>where
K: KVKey + Debug,
pub async fn delr<K>(&self, rng: Range<K>) -> Result<(), Error>where
K: KVKey + Debug,
Delete a range of keys from the datastore.
This function deletes entries from the underlying datastore in grouped batches.
Sourcepub async fn delp<K>(&self, key: &K) -> Result<(), Error>where
K: KVKey + Debug,
pub async fn delp<K>(&self, key: &K) -> Result<(), Error>where
K: KVKey + Debug,
Delete a prefix of keys from the datastore.
This function deletes entries from the underlying datastore in grouped batches.
Sourcepub async fn clr<K>(&self, key: &K) -> Result<(), Error>where
K: KVKey + Debug,
pub async fn clr<K>(&self, key: &K) -> Result<(), Error>where
K: KVKey + Debug,
Delete all versions of a key from the datastore.
Sourcepub async fn clrc<K>(
&self,
key: &K,
chk: Option<&<K as KVKey>::ValueType>,
) -> Result<(), Error>where
K: KVKey + Debug,
pub async fn clrc<K>(
&self,
key: &K,
chk: Option<&<K as KVKey>::ValueType>,
) -> Result<(), Error>where
K: KVKey + Debug,
Delete all versions of a key from the datastore if the current value matches a condition.
Sourcepub async fn clrr<K>(&self, rng: Range<K>) -> Result<(), Error>where
K: KVKey + Debug,
pub async fn clrr<K>(&self, rng: Range<K>) -> Result<(), Error>where
K: KVKey + Debug,
Delete all versions of a range of keys from the datastore.
This function deletes entries from the underlying datastore in grouped batches.
Sourcepub async fn clrp<K>(&self, key: &K) -> Result<(), Error>where
K: KVKey + Debug,
pub async fn clrp<K>(&self, key: &K) -> Result<(), Error>where
K: KVKey + Debug,
Delete all versions of a prefix of keys from the datastore.
This function deletes entries from the underlying datastore in grouped batches.
Sourcepub async fn set<K>(
&self,
key: &K,
val: &<K as KVKey>::ValueType,
version: Option<u64>,
) -> Result<(), Error>where
K: KVKey + Debug,
pub async fn set<K>(
&self,
key: &K,
val: &<K as KVKey>::ValueType,
version: Option<u64>,
) -> Result<(), Error>where
K: KVKey + Debug,
Insert or update a key in the datastore.
Sourcepub async fn put<K>(
&self,
key: &K,
val: &<K as KVKey>::ValueType,
version: Option<u64>,
) -> Result<(), Error>where
K: KVKey + Debug,
pub async fn put<K>(
&self,
key: &K,
val: &<K as KVKey>::ValueType,
version: Option<u64>,
) -> Result<(), Error>where
K: KVKey + Debug,
Insert a key if it doesn’t exist in the datastore.
Sourcepub async fn putc<K>(
&self,
key: &K,
val: &<K as KVKey>::ValueType,
chk: Option<&<K as KVKey>::ValueType>,
) -> Result<(), Error>where
K: KVKey + Debug,
pub async fn putc<K>(
&self,
key: &K,
val: &<K as KVKey>::ValueType,
chk: Option<&<K as KVKey>::ValueType>,
) -> Result<(), Error>where
K: KVKey + Debug,
Update a key in the datastore if the current value matches a condition.
Sourcepub async fn replace<K>(
&self,
key: &K,
val: &<K as KVKey>::ValueType,
) -> Result<(), Error>where
K: KVKey + Debug,
pub async fn replace<K>(
&self,
key: &K,
val: &<K as KVKey>::ValueType,
) -> Result<(), Error>where
K: KVKey + Debug,
Insert or replace a key in the datastore.
Sourcepub async fn keys<K>(
&self,
rng: Range<K>,
limit: u32,
skip: u32,
version: Option<u64>,
) -> Result<Vec<Vec<u8>>, Error>where
K: KVKey + Debug,
pub async fn keys<K>(
&self,
rng: Range<K>,
limit: u32,
skip: u32,
version: Option<u64>,
) -> Result<Vec<Vec<u8>>, Error>where
K: KVKey + Debug,
Retrieve a specific range of keys from the datastore.
This function fetches the full range of keys, in a single request to the underlying datastore.
Sourcepub async fn keysr<K>(
&self,
rng: Range<K>,
limit: u32,
skip: u32,
version: Option<u64>,
) -> Result<Vec<Vec<u8>>, Error>where
K: KVKey + Debug,
pub async fn keysr<K>(
&self,
rng: Range<K>,
limit: u32,
skip: u32,
version: Option<u64>,
) -> Result<Vec<Vec<u8>>, Error>where
K: KVKey + Debug,
Retrieve a specific range of keys from the datastore in reverse order.
This function fetches the full range of keys, in a single request to the underlying datastore.
Sourcepub async fn scan<K>(
&self,
rng: Range<K>,
limit: u32,
skip: u32,
version: Option<u64>,
) -> Result<Vec<(Vec<u8>, Vec<u8>)>, Error>where
K: KVKey + Debug,
pub async fn scan<K>(
&self,
rng: Range<K>,
limit: u32,
skip: u32,
version: Option<u64>,
) -> Result<Vec<(Vec<u8>, Vec<u8>)>, Error>where
K: KVKey + Debug,
Retrieve a specific range of keys from the datastore.
This function fetches the full range of key-value pairs, in a single request to the underlying datastore.
pub async fn scanr<K>(
&self,
rng: Range<K>,
limit: u32,
skip: u32,
version: Option<u64>,
) -> Result<Vec<(Vec<u8>, Vec<u8>)>, Error>where
K: KVKey + Debug,
Sourcepub async fn count<K>(
&self,
rng: Range<K>,
version: Option<u64>,
) -> Result<usize, Error>where
K: KVKey + Debug,
pub async fn count<K>(
&self,
rng: Range<K>,
version: Option<u64>,
) -> Result<usize, Error>where
K: KVKey + Debug,
Count the total number of keys within a range in the datastore.
This function fetches the total count, in batches, with multiple requests to the underlying datastore.
Sourcepub async fn batch_keys<K>(
&self,
rng: Range<K>,
batch: u32,
version: Option<u64>,
) -> Result<Batch<Vec<u8>>, Error>where
K: KVKey + Debug,
pub async fn batch_keys<K>(
&self,
rng: Range<K>,
batch: u32,
version: Option<u64>,
) -> Result<Batch<Vec<u8>>, Error>where
K: KVKey + Debug,
Retrieve a batched scan over a specific range of keys in the datastore.
This function fetches the keys in batches, with multiple requests to the underlying datastore.
Sourcepub async fn batch_keys_vals<K>(
&self,
rng: Range<K>,
batch: u32,
version: Option<u64>,
) -> Result<Batch<(Vec<u8>, Vec<u8>)>, Error>where
K: KVKey + Debug,
pub async fn batch_keys_vals<K>(
&self,
rng: Range<K>,
batch: u32,
version: Option<u64>,
) -> Result<Batch<(Vec<u8>, Vec<u8>)>, Error>where
K: KVKey + Debug,
Retrieve a batched scan over a specific range of keys in the datastore.
This function fetches the key-value pairs in batches, with multiple requests to the underlying datastore.
Sourcepub fn stream_keys(
&self,
rng: Range<Vec<u8>>,
version: Option<u64>,
limit: Option<usize>,
skip: u32,
dir: ScanDirection,
) -> impl Stream<Item = Result<Vec<Vec<u8>>, Error>>
pub fn stream_keys( &self, rng: Range<Vec<u8>>, version: Option<u64>, limit: Option<usize>, skip: u32, dir: ScanDirection, ) -> impl Stream<Item = Result<Vec<Vec<u8>>, Error>>
Retrieve a stream of key batches over a specific range in the datastore.
This function returns a stream that yields batches of keys. The scanner:
- Fetches an initial batch of up to 100 items
- Fetches subsequent batches of up to 16 MiB (local) or 4 MiB (remote)
- Prefetches the next batch while the current batch is being processed
Sourcepub fn stream_keys_vals(
&self,
rng: Range<Vec<u8>>,
version: Option<u64>,
limit: Option<usize>,
skip: u32,
dir: ScanDirection,
prefetch: bool,
) -> impl Stream<Item = Result<Vec<(Vec<u8>, Vec<u8>)>, Error>>
pub fn stream_keys_vals( &self, rng: Range<Vec<u8>>, version: Option<u64>, limit: Option<usize>, skip: u32, dir: ScanDirection, prefetch: bool, ) -> impl Stream<Item = Result<Vec<(Vec<u8>, Vec<u8>)>, Error>>
Retrieve a stream of key-value batches over a specific range in the datastore.
This function returns a stream that yields batches of key-value pairs. The scanner:
- Fetches an initial batch of up to 100 items (or 500 when
prefetchis enabled) - Fetches subsequent batches of up to 16 MiB (local) or 4 MiB (remote)
- When
prefetchis true, prefetches the next batch while the current batch is being processed, and uses a larger initial batch size (500 items)
Sourcepub async fn new_save_point(&self) -> Result<(), Error>
pub async fn new_save_point(&self) -> Result<(), Error>
Set a new save point on the transaction.
Sourcepub async fn release_last_save_point(&self) -> Result<(), Error>
pub async fn release_last_save_point(&self) -> Result<(), Error>
Release the last save point.
Sourcepub async fn rollback_to_save_point(&self) -> Result<(), Error>
pub async fn rollback_to_save_point(&self) -> Result<(), Error>
Rollback to the last save point.
Sourcepub async fn timestamp(&self) -> Result<BoxTimeStamp, Error>
pub async fn timestamp(&self) -> Result<BoxTimeStamp, Error>
Get the current monotonic timestamp
Sourcepub fn timestamp_impl(&self) -> Box<dyn TimeStampImpl>
pub fn timestamp_impl(&self) -> Box<dyn TimeStampImpl>
Returns the implementation of timestamp that this transaction uses.
Sourcepub fn clear_cache(&self)
pub fn clear_cache(&self)
Clears all keys from the transaction cache.
pub async fn compact<K>(&self, prefix_key: Option<K>) -> Result<(), Error>where
K: KVKey + Debug,
Methods from Deref<Target = Transactor>§
Sourcepub fn closed(&self) -> bool
pub fn closed(&self) -> bool
Check if transaction is finished.
If the transaction has been cancelled or committed,
then this function will return true, and any further
calls to functions on this transaction will result
in a crate::kvs::Error::TransactionFinished error.
Sourcepub fn writeable(&self) -> bool
pub fn writeable(&self) -> bool
Check if transaction is writeable.
If the transaction has been marked as a writeable
transaction, then this function will return true.
This fuction can be used to check whether a transaction
allows data to be modified, and if not then the function
will return a crate::kvs::Error::TransactionReadonly error when
attempting to modify any data within the transaction.
Sourcepub async fn cancel(&self) -> Result<(), Error>
pub async fn cancel(&self) -> Result<(), Error>
Cancel a transaction.
This reverses all changes made within the transaction.
Sourcepub async fn commit(&self) -> Result<(), Error>
pub async fn commit(&self) -> Result<(), Error>
Commit a transaction.
This attempts to commit all changes made within the transaction.
Sourcepub async fn exists<K>(
&self,
key: K,
version: Option<u64>,
) -> Result<bool, Error>
pub async fn exists<K>( &self, key: K, version: Option<u64>, ) -> Result<bool, Error>
Check if a key exists in the datastore.
Sourcepub async fn get<K>(
&self,
key: K,
version: Option<u64>,
) -> Result<Option<Vec<u8>>, Error>
pub async fn get<K>( &self, key: K, version: Option<u64>, ) -> Result<Option<Vec<u8>>, Error>
Fetch a key from the datastore.
Sourcepub async fn getm<K>(
&self,
keys: Vec<K>,
version: Option<u64>,
) -> Result<Vec<Option<Vec<u8>>>, Error>
pub async fn getm<K>( &self, keys: Vec<K>, version: Option<u64>, ) -> Result<Vec<Option<Vec<u8>>>, Error>
Fetch many keys from the datastore.
Sourcepub async fn getp<K>(&self, key: K) -> Result<Vec<(Vec<u8>, Vec<u8>)>, Error>
pub async fn getp<K>(&self, key: K) -> Result<Vec<(Vec<u8>, Vec<u8>)>, Error>
Retrieve a specific prefixed range of keys from the datastore.
This function fetches all matching key-value pairs from the underlying datastore in grouped batches.
Sourcepub async fn getr<K>(
&self,
rng: Range<K>,
version: Option<u64>,
) -> Result<Vec<(Vec<u8>, Vec<u8>)>, Error>
pub async fn getr<K>( &self, rng: Range<K>, version: Option<u64>, ) -> Result<Vec<(Vec<u8>, Vec<u8>)>, Error>
Retrieve a specific range of keys from the datastore.
This function fetches all matching key-value pairs from the underlying datastore in grouped batches.
Sourcepub async fn set<K, V>(
&self,
key: K,
val: V,
version: Option<u64>,
) -> Result<(), Error>
pub async fn set<K, V>( &self, key: K, val: V, version: Option<u64>, ) -> Result<(), Error>
Insert or update a key in the datastore.
Sourcepub async fn replace<K, V>(&self, key: K, val: V) -> Result<(), Error>
pub async fn replace<K, V>(&self, key: K, val: V) -> Result<(), Error>
Insert or replace a key in the datastore.
Sourcepub async fn put<K, V>(
&self,
key: K,
val: V,
version: Option<u64>,
) -> Result<(), Error>
pub async fn put<K, V>( &self, key: K, val: V, version: Option<u64>, ) -> Result<(), Error>
Insert a key if it doesn’t exist in the datastore.
Sourcepub async fn putc<K, V>(
&self,
key: K,
val: V,
chk: Option<V>,
) -> Result<(), Error>
pub async fn putc<K, V>( &self, key: K, val: V, chk: Option<V>, ) -> Result<(), Error>
Update a key in the datastore if the current value matches a condition.
Sourcepub async fn delc<K, V>(&self, key: K, chk: Option<V>) -> Result<(), Error>
pub async fn delc<K, V>(&self, key: K, chk: Option<V>) -> Result<(), Error>
Delete a key from the datastore if the current value matches a condition.
Sourcepub async fn delp<K>(&self, key: K) -> Result<(), Error>
pub async fn delp<K>(&self, key: K) -> Result<(), Error>
Delete a prefixed range of keys from the datastore.
This function deletes all matching key-value pairs from the underlying datastore in grouped batches.
Sourcepub async fn delr<K>(&self, rng: Range<K>) -> Result<(), Error>
pub async fn delr<K>(&self, rng: Range<K>) -> Result<(), Error>
Delete a range of keys from the datastore.
This function deletes all matching key-value pairs from the underlying datastore in grouped batches.
Sourcepub async fn clr<K>(&self, key: K) -> Result<(), Error>
pub async fn clr<K>(&self, key: K) -> Result<(), Error>
Delete all versions of a key from the datastore.
Sourcepub async fn clrc<K, V>(&self, key: K, chk: Option<V>) -> Result<(), Error>
pub async fn clrc<K, V>(&self, key: K, chk: Option<V>) -> Result<(), Error>
Delete all versions of a key from the datastore if the current value matches a condition.
Sourcepub async fn clrp<K>(&self, key: K) -> Result<(), Error>
pub async fn clrp<K>(&self, key: K) -> Result<(), Error>
Delete all versions of a prefixed range of keys from the datastore.
This function deletes all matching key-value pairs from the underlying datastore in grouped batches.
Sourcepub async fn clrr<K>(&self, rng: Range<K>) -> Result<(), Error>
pub async fn clrr<K>(&self, rng: Range<K>) -> Result<(), Error>
Delete all versions of a range of keys from the datastore.
This function deletes all matching key-value pairs from the underlying datastore in grouped batches.
Sourcepub async fn keys<K>(
&self,
rng: Range<K>,
limit: ScanLimit,
skip: u32,
version: Option<u64>,
) -> Result<Vec<Vec<u8>>, Error>
pub async fn keys<K>( &self, rng: Range<K>, limit: ScanLimit, skip: u32, version: Option<u64>, ) -> Result<Vec<Vec<u8>>, Error>
Retrieve a specific range of keys from the datastore.
This function fetches the full range of keys without values, in a single request to the underlying datastore.
Sourcepub async fn keysr<K>(
&self,
rng: Range<K>,
limit: ScanLimit,
skip: u32,
version: Option<u64>,
) -> Result<Vec<Vec<u8>>, Error>
pub async fn keysr<K>( &self, rng: Range<K>, limit: ScanLimit, skip: u32, version: Option<u64>, ) -> Result<Vec<Vec<u8>>, Error>
Retrieve a specific range of keys from the datastore.
This function fetches the full range of keys without values, in a single request to the underlying datastore.
Sourcepub async fn scan<K>(
&self,
rng: Range<K>,
limit: ScanLimit,
skip: u32,
version: Option<u64>,
) -> Result<Vec<(Vec<u8>, Vec<u8>)>, Error>
pub async fn scan<K>( &self, rng: Range<K>, limit: ScanLimit, skip: u32, version: Option<u64>, ) -> Result<Vec<(Vec<u8>, Vec<u8>)>, Error>
Retrieve a specific range of key-value pairs from the datastore.
This function fetches the full range of key-value pairs, in a single request to the underlying datastore.
Sourcepub async fn scanr<K>(
&self,
rng: Range<K>,
limit: ScanLimit,
skip: u32,
version: Option<u64>,
) -> Result<Vec<(Vec<u8>, Vec<u8>)>, Error>
pub async fn scanr<K>( &self, rng: Range<K>, limit: ScanLimit, skip: u32, version: Option<u64>, ) -> Result<Vec<(Vec<u8>, Vec<u8>)>, Error>
Retrieve a specific range of key-value pairs from the datastore.
This function fetches the full range of key-value pairs, in a single request to the underlying datastore.
Sourcepub async fn count<K>(
&self,
rng: Range<K>,
version: Option<u64>,
) -> Result<usize, Error>
pub async fn count<K>( &self, rng: Range<K>, version: Option<u64>, ) -> Result<usize, Error>
Count the total number of keys within a range in the datastore.
This function fetches the total count, in batches, with multiple requests to the underlying datastore.
Sourcepub async fn batch_keys<K>(
&self,
rng: Range<K>,
batch: u32,
version: Option<u64>,
) -> Result<Batch<Vec<u8>>, Error>
pub async fn batch_keys<K>( &self, rng: Range<K>, batch: u32, version: Option<u64>, ) -> Result<Batch<Vec<u8>>, Error>
Retrieve a batched scan over a specific range of keys in the datastore.
This function fetches keys, in batches, with multiple requests to the underlying datastore.
Sourcepub async fn batch_keys_vals<K>(
&self,
rng: Range<K>,
batch: u32,
version: Option<u64>,
) -> Result<Batch<(Vec<u8>, Vec<u8>)>, Error>
pub async fn batch_keys_vals<K>( &self, rng: Range<K>, batch: u32, version: Option<u64>, ) -> Result<Batch<(Vec<u8>, Vec<u8>)>, Error>
Retrieve a batched scan over a specific range of keys in the datastore.
This function fetches key-value pairs, in batches, with multiple requests to the underlying datastore.
Sourcepub fn stream_keys<K>(
&self,
rng: Range<K>,
version: Option<u64>,
limit: Option<usize>,
skip: u32,
dir: Direction,
) -> impl Stream<Item = Result<Vec<Vec<u8>>, Error>>
pub fn stream_keys<K>( &self, rng: Range<K>, version: Option<u64>, limit: Option<usize>, skip: u32, dir: Direction, ) -> impl Stream<Item = Result<Vec<Vec<u8>>, Error>>
Retrieve a stream of key batches over a specific range in the datastore.
This function returns a stream that yields batches of keys. The scanner:
- Fetches an initial batch of up to 500 items
- Fetches subsequent batches of up to 16 MiB (local) or 4 MiB (remote)
- Prefetches the next batch while the current batch is being processed
Sourcepub fn stream_keys_vals<K>(
&self,
rng: Range<K>,
version: Option<u64>,
limit: Option<usize>,
skip: u32,
dir: Direction,
prefetch: bool,
) -> impl Stream<Item = Result<Vec<(Vec<u8>, Vec<u8>)>, Error>>
pub fn stream_keys_vals<K>( &self, rng: Range<K>, version: Option<u64>, limit: Option<usize>, skip: u32, dir: Direction, prefetch: bool, ) -> impl Stream<Item = Result<Vec<(Vec<u8>, Vec<u8>)>, Error>>
Retrieve a stream of key-value batches over a specific range in the datastore.
This function returns a stream that yields batches of key-value pairs. The scanner:
- Fetches an initial batch of up to 500 items (or 1000 when
prefetchis enabled) - Fetches subsequent batches of up to 16 MiB (local) or 4 MiB (remote)
- When
prefetchis true, prefetches the next batch while the current batch is being processed, and uses a larger initial batch size (500 items)
Sourcepub async fn new_save_point(&self) -> Result<(), Error>
pub async fn new_save_point(&self) -> Result<(), Error>
Set a new save point on the transaction.
Sourcepub async fn release_last_save_point(&self) -> Result<(), Error>
pub async fn release_last_save_point(&self) -> Result<(), Error>
Release the last save point.
Sourcepub async fn rollback_to_save_point(&self) -> Result<(), Error>
pub async fn rollback_to_save_point(&self) -> Result<(), Error>
Rollback to the last save point.
Sourcepub async fn timestamp(&self) -> Result<BoxTimeStamp, Error>
pub async fn timestamp(&self) -> Result<BoxTimeStamp, Error>
Get the current monotonic timestamp
Sourcepub fn timestamp_impl(&self) -> Box<dyn TimeStampImpl>
pub fn timestamp_impl(&self) -> Box<dyn TimeStampImpl>
Returns the implementation of timestamp that this transaction uses.
Trait Implementations§
Source§impl Deref for Transaction
impl Deref for Transaction
Source§type Target = Transactor
type Target = Transactor
Source§impl From<Transaction> for Context
impl From<Transaction> for Context
Source§fn from(txn: Transaction) -> Context
fn from(txn: Transaction) -> Context
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§
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
self file descriptor. Read moreSource§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>
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn add_extension<T>(self, value: T) -> AddExtension<Self, T>where
Self: Sized,
fn add_extension<T>(self, value: T) -> AddExtension<Self, T>where
Self: Sized,
Source§fn compression(self) -> Compression<Self>where
Self: Sized,
fn compression(self) -> Compression<Self>where
Self: Sized,
Source§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
Source§fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
Source§fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
Source§fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
Source§fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
Source§fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
Source§fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
Source§fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
Source§fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
Source§fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
Source§fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
Source§fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
Source§fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
x-request-id as the header name. Read moreSource§fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
Source§fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
x-request-id as the header name. Read moreSource§fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
Self: Sized,
fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
Self: Sized,
500 Internal Server responses. Read moreSource§fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
413 Payload Too Large responses. Read more