pub struct SerializableReadSession { /* private fields */ }Expand description
A session that enforces monotonic read consistency via a fixed min_sequence_number floor.
StoreClient itself does not retain any client-global observed sequence.
Plain query reads are stateless unless the caller passes an explicit
min_sequence_number.
A SerializableReadSession is the explicit consistency mechanism. The first
successful unary read seeds the session from the server-reported sequence,
and every later read passes that fixed floor so the server guarantees all
responses reflect at least that point in the write log.
Streamed query reads (get_many, range_stream) only expose their final
sequence in stream trailers, so if one of those is the first successful
read, the session is not pinned until that stream is fully drained.
Implementations§
Source§impl SerializableReadSession
impl SerializableReadSession
Sourcepub fn fixed_sequence(&self) -> Option<u64>
pub fn fixed_sequence(&self) -> Option<u64>
Fixed sequence floor for this session, if one has been established yet.
Fresh sessions start with None unless created via
StoreClient::create_session_with_sequence. A first streamed query
read (get_many, range_stream) only sets this once the stream is
fully drained and trailers are available.
pub async fn get(&self, key: &Key) -> Result<Option<Bytes>, ClientError>
pub async fn get_many( &self, keys: &[&Key], batch_size: u32, ) -> Result<GetManyStream, ClientError>
pub async fn range( &self, start: &Key, end: &Key, limit: usize, ) -> Result<Vec<(Key, Bytes)>, ClientError>
pub async fn range_with_mode( &self, start: &Key, end: &Key, limit: usize, mode: RangeMode, ) -> Result<Vec<(Key, Bytes)>, ClientError>
pub async fn range_stream( &self, start: &Key, end: &Key, limit: usize, batch_size: usize, ) -> Result<RangeStream, ClientError>
pub async fn range_stream_with_mode( &self, start: &Key, end: &Key, limit: usize, batch_size: usize, mode: RangeMode, ) -> Result<RangeStream, ClientError>
pub async fn range_reduce( &self, start: &Key, end: &Key, request: &DomainRangeReduceRequest, ) -> Result<Vec<Option<KvReducedValue>>, ClientError>
pub async fn range_reduce_response( &self, start: &Key, end: &Key, request: &DomainRangeReduceRequest, ) -> Result<ReduceResponse, ClientError>
Trait Implementations§
Source§impl Clone for SerializableReadSession
impl Clone for SerializableReadSession
Source§fn clone(&self) -> SerializableReadSession
fn clone(&self) -> SerializableReadSession
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more