pub struct ShardCacheDirectShardClient { /* private fields */ }Expand description
Blocking SCNP client pinned to one shard-owned port.
This is useful for thread-per-shard clients that pre-partition work.
Implementations§
Source§impl ShardCacheDirectShardClient
impl ShardCacheDirectShardClient
Sourcepub fn get_into(&mut self, key: &[u8], out: &mut Vec<u8>) -> Result<bool>
pub fn get_into(&mut self, key: &[u8], out: &mut Vec<u8>) -> Result<bool>
Reads key into out, returning true on hit.
Sourcepub fn set_ex(&mut self, key: &[u8], value: &[u8], ttl_ms: u64) -> Result<()>
pub fn set_ex(&mut self, key: &[u8], value: &[u8], ttl_ms: u64) -> Result<()>
Sets key to value with a millisecond TTL.
Sourcepub fn get_ex_into(
&mut self,
key: &[u8],
ttl_ms: u64,
out: &mut Vec<u8>,
) -> Result<bool>
pub fn get_ex_into( &mut self, key: &[u8], ttl_ms: u64, out: &mut Vec<u8>, ) -> Result<bool>
Reads key into out and sets a millisecond TTL, returning true on hit.
Sourcepub fn del(&mut self, key: &[u8]) -> Result<bool>
pub fn del(&mut self, key: &[u8]) -> Result<bool>
Deletes key, returning true when an entry was removed.
Sourcepub fn expire(&mut self, key: &[u8], ttl_ms: u64) -> Result<bool>
pub fn expire(&mut self, key: &[u8], ttl_ms: u64) -> Result<bool>
Sets a millisecond TTL on key, returning true when the TTL changed.
Sourcepub fn scan_resp_into(
&mut self,
cursor: u64,
count: usize,
out: &mut Vec<u8>,
) -> Result<bool>
pub fn scan_resp_into( &mut self, cursor: u64, count: usize, out: &mut Vec<u8>, ) -> Result<bool>
Runs a shard-local SCNP scan on this shard-owned connection.
Sourcepub fn begin_pipeline_get(&mut self, key: &[u8]) -> Result<()>
pub fn begin_pipeline_get(&mut self, key: &[u8]) -> Result<()>
Writes a routed GET request without flushing or reading its response.
Sourcepub fn begin_pipeline_set(&mut self, key: &[u8], value: &[u8]) -> Result<()>
pub fn begin_pipeline_set(&mut self, key: &[u8], value: &[u8]) -> Result<()>
Writes a routed SET request without flushing or reading its response.
Sourcepub fn begin_pipeline_set_ex(
&mut self,
key: &[u8],
value: &[u8],
ttl_ms: u64,
) -> Result<()>
pub fn begin_pipeline_set_ex( &mut self, key: &[u8], value: &[u8], ttl_ms: u64, ) -> Result<()>
Writes a routed SETEX request without flushing or reading its response.
Sourcepub fn begin_pipeline_get_ex(&mut self, key: &[u8], ttl_ms: u64) -> Result<()>
pub fn begin_pipeline_get_ex(&mut self, key: &[u8], ttl_ms: u64) -> Result<()>
Writes a routed GETEX request without flushing or reading its response.
Sourcepub fn begin_pipeline_del(&mut self, key: &[u8]) -> Result<()>
pub fn begin_pipeline_del(&mut self, key: &[u8]) -> Result<()>
Writes a routed DEL request without flushing or reading its response.
Sourcepub fn begin_pipeline_exists(&mut self, key: &[u8]) -> Result<()>
pub fn begin_pipeline_exists(&mut self, key: &[u8]) -> Result<()>
Writes a routed EXISTS request without flushing or reading its response.
Sourcepub fn begin_pipeline_ttl(&mut self, key: &[u8]) -> Result<()>
pub fn begin_pipeline_ttl(&mut self, key: &[u8]) -> Result<()>
Writes a routed TTL request without flushing or reading its response.
Sourcepub fn begin_pipeline_expire(&mut self, key: &[u8], ttl_ms: u64) -> Result<()>
pub fn begin_pipeline_expire(&mut self, key: &[u8], ttl_ms: u64) -> Result<()>
Writes a routed EXPIRE request without flushing or reading its response.
Sourcepub fn flush_pipeline(&mut self) -> Result<()>
pub fn flush_pipeline(&mut self) -> Result<()>
Flushes all queued pipelined requests.
Sourcepub fn finish_pipeline_get_into(&mut self, out: &mut Vec<u8>) -> Result<bool>
pub fn finish_pipeline_get_into(&mut self, out: &mut Vec<u8>) -> Result<bool>
Reads the next pipelined GET response.
Sourcepub fn finish_pipeline_set(&mut self) -> Result<()>
pub fn finish_pipeline_set(&mut self) -> Result<()>
Reads the next pipelined SET response.
Sourcepub fn finish_pipeline_set_ex(&mut self) -> Result<()>
pub fn finish_pipeline_set_ex(&mut self) -> Result<()>
Reads the next pipelined SETEX response.
Sourcepub fn finish_pipeline_get_ex_into(&mut self, out: &mut Vec<u8>) -> Result<bool>
pub fn finish_pipeline_get_ex_into(&mut self, out: &mut Vec<u8>) -> Result<bool>
Reads the next pipelined GETEX response.
Sourcepub fn finish_pipeline_del(&mut self) -> Result<bool>
pub fn finish_pipeline_del(&mut self) -> Result<bool>
Reads the next pipelined DEL response.
Sourcepub fn finish_pipeline_exists(&mut self) -> Result<bool>
pub fn finish_pipeline_exists(&mut self) -> Result<bool>
Reads the next pipelined EXISTS response.
Sourcepub fn finish_pipeline_ttl(&mut self) -> Result<i64>
pub fn finish_pipeline_ttl(&mut self) -> Result<i64>
Reads the next pipelined TTL response.
Sourcepub fn finish_pipeline_expire(&mut self) -> Result<bool>
pub fn finish_pipeline_expire(&mut self) -> Result<bool>
Reads the next pipelined EXPIRE response.