Struct tikv_client::Snapshot[][src]

pub struct Snapshot {
    transaction: Transaction,
}

A read-only transaction which reads at the given timestamp.

It behaves as if the snapshot was taken at the given timestamp, i.e. it can read operations happened before the timestamp, but ignores operations after the timestamp.

See the Transaction docs for more information on the methods.

Fields

transaction: Transaction

Implementations

impl Snapshot[src]

pub fn new(transaction: Transaction) -> Self[src]

Constructs a new Snapshot.

impl Snapshot[src]

pub async fn get(&self, key: impl Into<Key>) -> Result<Option<Value>>[src]

Get the value associated with the given key.

pub async fn key_exists(&self, key: impl Into<Key>) -> Result<bool>[src]

Check whether the key exists.

pub async fn batch_get(
    &self,
    keys: impl IntoIterator<Item = impl Into<Key>>
) -> Result<impl Iterator<Item = KvPair>>
[src]

Get the values associated with the given keys.

pub async fn scan(
    &self,
    range: impl Into<BoundRange>,
    limit: u32
) -> Result<impl Iterator<Item = KvPair>>
[src]

Scan a range, return at most limit key-value pairs that lying in the range.

pub async fn scan_keys(
    &self,
    range: impl Into<BoundRange>,
    limit: u32
) -> Result<impl Iterator<Item = Key>>
[src]

Scan a range, return at most limit keys that lying in the range.

fn scan_reverse(
    &self,
    range: impl RangeBounds<Key>
) -> BoxStream<'_, Result<KvPair>>
[src]

Unimplemented. Similar to scan, but in the reverse direction.

Auto Trait Implementations

impl !RefUnwindSafe for Snapshot

impl Send for Snapshot

impl Sync for Snapshot

impl Unpin for Snapshot

impl !UnwindSafe for Snapshot

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]