pub struct PrefixedStoreClient { /* private fields */ }Expand description
A physical StoreClient paired with a StoreKeyPrefix that namespaces
every key on the wire. The prefix can be the zero-width
StoreKeyPrefix::identity, representing the un-namespaced case.
Implementations§
Source§impl PrefixedStoreClient
impl PrefixedStoreClient
Sourcepub fn new(client: StoreClient, prefix: StoreKeyPrefix) -> Self
pub fn new(client: StoreClient, prefix: StoreKeyPrefix) -> Self
Pair a physical client with an explicit namespace prefix.
Sourcepub fn empty(client: StoreClient) -> Self
pub fn empty(client: StoreClient) -> Self
Pair a physical client with the zero-width StoreKeyPrefix::identity,
so keys pass through untranslated.
Sourcepub fn key_prefix(&self) -> &StoreKeyPrefix
pub fn key_prefix(&self) -> &StoreKeyPrefix
The configured key prefix.
Sourcepub fn client(&self) -> &StoreClient
pub fn client(&self) -> &StoreClient
Borrow the underlying physical transport. Operations performed directly on it are not namespaced; prefer the methods on this type.
Sourcepub fn encode_store_key(&self, key: &Key) -> Result<Key, ClientError>
pub fn encode_store_key(&self, key: &Key) -> Result<Key, ClientError>
Encode a logical key as it will appear in the physical Store.
Sourcepub fn decode_store_key(&self, key: &Key) -> Result<Key, ClientError>
pub fn decode_store_key(&self, key: &Key) -> Result<Key, ClientError>
Decode a physical Store key into this client’s logical keyspace.
Sourcepub fn create_session(&self) -> SerializableReadSession
pub fn create_session(&self) -> SerializableReadSession
Create an unseeded serializable read session over this namespace.
Sourcepub fn create_session_with_sequence(
&self,
sequence: u64,
) -> SerializableReadSession
pub fn create_session_with_sequence( &self, sequence: u64, ) -> SerializableReadSession
Create a serializable read session pinned to at least sequence.
Trait Implementations§
Source§impl Clone for PrefixedStoreClient
impl Clone for PrefixedStoreClient
Source§fn clone(&self) -> PrefixedStoreClient
fn clone(&self) -> PrefixedStoreClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more