Struct fdb::transaction::FdbReadTransaction
source · pub struct FdbReadTransaction { /* private fields */ }
Expand description
A handle to a FDB snapshot, suitable for performing snapshot reads.
Snapshot reads offer more relaxed isolation level than FDB’s default serializable isolation, reducing transaction conflicts but making it harder to reason about concurrency.
For more information about how to use snapshot reads correctly, see snapshot reads.
snapshot
method on FdbTransaction
can be used to create a
FdbReadTransaction
.
Implementations§
source§impl FdbReadTransaction
impl FdbReadTransaction
sourcepub async unsafe fn read<T, F, Fut>(&self, f: F) -> FdbResult<T>where
F: FnMut(FdbReadTransaction) -> Fut,
Fut: Future<Output = FdbResult<T>>,
pub async unsafe fn read<T, F, Fut>(&self, f: F) -> FdbResult<T>where F: FnMut(FdbReadTransaction) -> Fut, Fut: Future<Output = FdbResult<T>>,
Runs a closure in the context of this FdbReadTransaction
.
Safety
You should not use this API. It exists to support binding tester.
Trait Implementations§
source§impl Clone for FdbReadTransaction
impl Clone for FdbReadTransaction
source§fn clone(&self) -> FdbReadTransaction
fn clone(&self) -> FdbReadTransaction
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 Debug for FdbReadTransaction
impl Debug for FdbReadTransaction
source§impl ReadTransaction for FdbReadTransaction
impl ReadTransaction for FdbReadTransaction
source§unsafe fn on_error(&self, e: FdbError) -> FdbFutureUnit
unsafe fn on_error(&self, e: FdbError) -> FdbFutureUnit
Determines whether an error returned by a
Transaction
or ReadTransaction
method is retryable. Waiting on the returned future will
return the same error when fatal, or return ()
for retryable
errors. Read moresource§fn get(&self, key: impl Into<Key>) -> FdbFutureMaybeValue
fn get(&self, key: impl Into<Key>) -> FdbFutureMaybeValue
Gets a value from the database. Read more
source§fn get_addresses_for_key(&self, key: impl Into<Key>) -> FdbFutureCStringArray
fn get_addresses_for_key(&self, key: impl Into<Key>) -> FdbFutureCStringArray
source§fn get_estimated_range_size_bytes(&self, range: Range) -> FdbFutureI64
fn get_estimated_range_size_bytes(&self, range: Range) -> FdbFutureI64
Gets an estimate for the number of bytes stored in the given
range. Read more
source§fn get_key(&self, selector: KeySelector) -> FdbFutureKey
fn get_key(&self, selector: KeySelector) -> FdbFutureKey
Returns the key referenced by the specificed
KeySelector
. Read moresource§fn get_mapped_range(
&self,
begin: KeySelector,
end: KeySelector,
mapper: impl Into<Mapper>,
options: RangeOptions
) -> FdbStreamMappedKeyValue
fn get_mapped_range( &self, begin: KeySelector, end: KeySelector, mapper: impl Into<Mapper>, options: RangeOptions ) -> FdbStreamMappedKeyValue
WARNING: This feature is considered experimental at this time. Read more
source§fn get_range(
&self,
begin: KeySelector,
end: KeySelector,
options: RangeOptions
) -> FdbStreamKeyValue
fn get_range( &self, begin: KeySelector, end: KeySelector, options: RangeOptions ) -> FdbStreamKeyValue
Gets an ordered range of keys and values from the database. Read more
source§fn get_range_split_points(
&self,
begin: impl Into<Key>,
end: impl Into<Key>,
chunk_size: i64
) -> FdbFutureKeyArray
fn get_range_split_points( &self, begin: impl Into<Key>, end: impl Into<Key>, chunk_size: i64 ) -> FdbFutureKeyArray
Gets a list of keys that can split the given range into
(roughly) equally sized chunks based on
chunk_size
. Read moresource§unsafe fn get_read_version(&self) -> FdbFutureI64
unsafe fn get_read_version(&self) -> FdbFutureI64
Gets the version at which the reads for this
Transaction
or ReadTransaction
will access the database. Read moresource§unsafe fn set_option(&self, option: TransactionOption) -> FdbResult<()>
unsafe fn set_option(&self, option: TransactionOption) -> FdbResult<()>
source§unsafe fn set_read_version(&self, version: i64)
unsafe fn set_read_version(&self, version: i64)
Directly sets the version of the database at which to execute
reads. Read more
Auto Trait Implementations§
impl RefUnwindSafe for FdbReadTransaction
impl Send for FdbReadTransaction
impl Sync for FdbReadTransaction
impl Unpin for FdbReadTransaction
impl UnwindSafe for FdbReadTransaction
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