Skip to main content

ShardCacheDirectShardClient

Struct ShardCacheDirectShardClient 

Source
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

Source

pub fn shard_id(&self) -> usize

Returns the shard this client is connected to.

Source

pub fn get_into(&mut self, key: &[u8], out: &mut Vec<u8>) -> Result<bool>

Reads key into out, returning true on hit.

Source

pub fn set(&mut self, key: &[u8], value: &[u8]) -> Result<()>

Sets key to value.

Source

pub fn set_ex(&mut self, key: &[u8], value: &[u8], ttl_ms: u64) -> Result<()>

Sets key to value with a millisecond TTL.

Source

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.

Source

pub fn del(&mut self, key: &[u8]) -> Result<bool>

Deletes key, returning true when an entry was removed.

Source

pub fn exists(&mut self, key: &[u8]) -> Result<bool>

Returns whether key exists.

Source

pub fn ttl(&mut self, key: &[u8]) -> Result<i64>

Returns Redis-compatible TTL seconds for key.

Source

pub fn expire(&mut self, key: &[u8], ttl_ms: u64) -> Result<bool>

Sets a millisecond TTL on key, returning true when the TTL changed.

Source

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.

Source

pub fn begin_pipeline_get(&mut self, key: &[u8]) -> Result<()>

Writes a routed GET request without flushing or reading its response.

Source

pub fn begin_pipeline_set(&mut self, key: &[u8], value: &[u8]) -> Result<()>

Writes a routed SET request without flushing or reading its response.

Source

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.

Source

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.

Source

pub fn begin_pipeline_del(&mut self, key: &[u8]) -> Result<()>

Writes a routed DEL request without flushing or reading its response.

Source

pub fn begin_pipeline_exists(&mut self, key: &[u8]) -> Result<()>

Writes a routed EXISTS request without flushing or reading its response.

Source

pub fn begin_pipeline_ttl(&mut self, key: &[u8]) -> Result<()>

Writes a routed TTL request without flushing or reading its response.

Source

pub fn begin_pipeline_expire(&mut self, key: &[u8], ttl_ms: u64) -> Result<()>

Writes a routed EXPIRE request without flushing or reading its response.

Source

pub fn flush_pipeline(&mut self) -> Result<()>

Flushes all queued pipelined requests.

Source

pub fn finish_pipeline_get_into(&mut self, out: &mut Vec<u8>) -> Result<bool>

Reads the next pipelined GET response.

Source

pub fn finish_pipeline_set(&mut self) -> Result<()>

Reads the next pipelined SET response.

Source

pub fn finish_pipeline_set_ex(&mut self) -> Result<()>

Reads the next pipelined SETEX response.

Source

pub fn finish_pipeline_get_ex_into(&mut self, out: &mut Vec<u8>) -> Result<bool>

Reads the next pipelined GETEX response.

Source

pub fn finish_pipeline_del(&mut self) -> Result<bool>

Reads the next pipelined DEL response.

Source

pub fn finish_pipeline_exists(&mut self) -> Result<bool>

Reads the next pipelined EXISTS response.

Source

pub fn finish_pipeline_ttl(&mut self) -> Result<i64>

Reads the next pipelined TTL response.

Source

pub fn finish_pipeline_expire(&mut self) -> Result<bool>

Reads the next pipelined EXPIRE response.

Trait Implementations§

Source§

impl Debug for ShardCacheDirectShardClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.