@@ -131,7 +131,18 @@ impl SyncTransactionClient {
131131 Ok ( SyncTransaction :: new ( inner, Arc :: clone ( & self . runtime ) ) )
132132 }
133133
134- /// Create a new [`SyncSnapshot`] at the given [`Timestamp`].
134+ /// Create a new read-only [`SyncSnapshot`] at the given [`Timestamp`].
135+ ///
136+ /// A snapshot is a read-only transaction that reads data as if the snapshot was taken at the
137+ /// specified timestamp. It can read operations that happened before the timestamp, but ignores
138+ /// operations after the timestamp.
139+ ///
140+ /// Use snapshots when you need:
141+ /// - Consistent reads across multiple operations without starting a full transaction
142+ /// - Point-in-time reads at a specific timestamp
143+ /// - Read-only access without the overhead of transaction tracking
144+ ///
145+ /// Unlike transactions, snapshots cannot perform write operations (put, delete, etc.).
135146 ///
136147 /// This is a synchronous version of [`TransactionClient::snapshot`](crate::TransactionClient::snapshot).
137148 ///
@@ -141,7 +152,10 @@ impl SyncTransactionClient {
141152 /// # use tikv_client::{SyncTransactionClient, TransactionOptions};
142153 /// let client = SyncTransactionClient::new(vec!["192.168.0.100"]).unwrap();
143154 /// let timestamp = client.current_timestamp().unwrap();
144- /// let snapshot = client.snapshot(timestamp, TransactionOptions::default());
155+ /// let mut snapshot = client.snapshot(timestamp, TransactionOptions::default());
156+ ///
157+ /// // Read data as it existed at the snapshot timestamp
158+ /// let value = snapshot.get("key".to_owned()).unwrap();
145159 /// ```
146160 pub fn snapshot ( & self , timestamp : Timestamp , options : TransactionOptions ) -> SyncSnapshot {
147161 let inner = self . client . snapshot ( timestamp, options) ;
0 commit comments