pub struct AtomicAllShards<'a> { /* private fields */ }Expand description
Context handed to the atomic_all_shards closure body. Methods
route to the right shard by hashing the key.
Implementations§
Source§impl<'a> AtomicAllShards<'a>
impl<'a> AtomicAllShards<'a>
Sourcepub fn incr(&mut self, key: &[u8]) -> KevyResult<i64>
pub fn incr(&mut self, key: &[u8]) -> KevyResult<i64>
INCR key.
Sourcepub fn hset(
&mut self,
key: &[u8],
pairs: &[(&[u8], &[u8])],
) -> KevyResult<usize>
pub fn hset( &mut self, key: &[u8], pairs: &[(&[u8], &[u8])], ) -> KevyResult<usize>
HSET key field value [field value ...]. Returns count newly
added (existing fields are overwritten but not counted).
Sourcepub fn hget(&mut self, key: &[u8], field: &[u8]) -> KevyResult<Option<Vec<u8>>>
pub fn hget(&mut self, key: &[u8], field: &[u8]) -> KevyResult<Option<Vec<u8>>>
HGET key field — None when the key or field is absent.
Sourcepub fn hincrby(
&mut self,
key: &[u8],
field: &[u8],
delta: i64,
) -> KevyResult<i64>
pub fn hincrby( &mut self, key: &[u8], field: &[u8], delta: i64, ) -> KevyResult<i64>
HINCRBY key field delta — returns the field’s new value.
Sourcepub fn zadd(&mut self, key: &[u8], pairs: &[(f64, &[u8])]) -> KevyResult<usize>
pub fn zadd(&mut self, key: &[u8], pairs: &[(f64, &[u8])]) -> KevyResult<usize>
ZADD key score member [score member ...]. Returns count newly
added (score updates of existing members are not counted).
Sourcepub fn zincrby(
&mut self,
key: &[u8],
delta: f64,
member: &[u8],
) -> KevyResult<f64>
pub fn zincrby( &mut self, key: &[u8], delta: f64, member: &[u8], ) -> KevyResult<f64>
ZINCRBY key delta member — returns the member’s new score.
Sourcepub fn zscore(&mut self, key: &[u8], member: &[u8]) -> KevyResult<Option<f64>>
pub fn zscore(&mut self, key: &[u8], member: &[u8]) -> KevyResult<Option<f64>>
ZSCORE key member (parity with super::ops_atomic::AtomicCtx).
Sourcepub fn del(&mut self, keys: &[&[u8]]) -> usize
pub fn del(&mut self, keys: &[&[u8]]) -> usize
DEL key [key ...] — keys may span shards; each key’s delete
is applied and AOF-logged on its own shard.
Sourcepub fn exists(&mut self, keys: &[&[u8]]) -> usize
pub fn exists(&mut self, keys: &[&[u8]]) -> usize
EXISTS key [key ...] — count of the given keys that exist.
Sourcepub fn hdel(&mut self, key: &[u8], fields: &[&[u8]]) -> KevyResult<usize>
pub fn hdel(&mut self, key: &[u8], fields: &[&[u8]]) -> KevyResult<usize>
HDEL key field [field ...].
Sourcepub fn hgetall(&mut self, key: &[u8]) -> KevyResult<Vec<(Vec<u8>, Vec<u8>)>>
pub fn hgetall(&mut self, key: &[u8]) -> KevyResult<Vec<(Vec<u8>, Vec<u8>)>>
HGETALL key — (field, value) pairs.
Sourcepub fn hmget(
&mut self,
key: &[u8],
fields: &[&[u8]],
) -> KevyResult<Vec<Option<Vec<u8>>>>
pub fn hmget( &mut self, key: &[u8], fields: &[&[u8]], ) -> KevyResult<Vec<Option<Vec<u8>>>>
HMGET key field [field ...] — None per absent field.
Sourcepub fn sadd(&mut self, key: &[u8], members: &[&[u8]]) -> KevyResult<usize>
pub fn sadd(&mut self, key: &[u8], members: &[&[u8]]) -> KevyResult<usize>
SADD key member [member ...].
Sourcepub fn srem(&mut self, key: &[u8], members: &[&[u8]]) -> KevyResult<usize>
pub fn srem(&mut self, key: &[u8], members: &[&[u8]]) -> KevyResult<usize>
SREM key member [member ...].
Sourcepub fn lpush(&mut self, key: &[u8], values: &[&[u8]]) -> KevyResult<usize>
pub fn lpush(&mut self, key: &[u8], values: &[&[u8]]) -> KevyResult<usize>
LPUSH key value [value ...] — returns the new list length.
Sourcepub fn rpush(&mut self, key: &[u8], values: &[&[u8]]) -> KevyResult<usize>
pub fn rpush(&mut self, key: &[u8], values: &[&[u8]]) -> KevyResult<usize>
RPUSH key value [value ...] — returns the new list length.
Sourcepub fn zrem(&mut self, key: &[u8], members: &[&[u8]]) -> KevyResult<usize>
pub fn zrem(&mut self, key: &[u8], members: &[&[u8]]) -> KevyResult<usize>
ZREM key member [member ...].
Sourcepub fn zcard(&mut self, key: &[u8]) -> KevyResult<usize>
pub fn zcard(&mut self, key: &[u8]) -> KevyResult<usize>
ZCARD key — member count; 0 when absent.
Sourcepub fn zadd_flags(
&mut self,
key: &[u8],
pairs: &[(f64, &[u8])],
flags: ZaddFlags,
) -> KevyResult<ZaddReport>
pub fn zadd_flags( &mut self, key: &[u8], pairs: &[(f64, &[u8])], flags: ZaddFlags, ) -> KevyResult<ZaddReport>
Flags-aware ZADD. AOF logs the applied pairs as plain
ZADD — the effect, never the condition (deterministic replay).
Source§impl AtomicAllShards<'_>
impl AtomicAllShards<'_>
Sourcepub fn sismember(&mut self, key: &[u8], member: &[u8]) -> KevyResult<bool>
pub fn sismember(&mut self, key: &[u8], member: &[u8]) -> KevyResult<bool>
SISMEMBER key member.
Sourcepub fn lrange(
&mut self,
key: &[u8],
start: i64,
stop: i64,
) -> KevyResult<Vec<Vec<u8>>>
pub fn lrange( &mut self, key: &[u8], start: i64, stop: i64, ) -> KevyResult<Vec<Vec<u8>>>
LRANGE key start stop.
Sourcepub fn llen(&mut self, key: &[u8]) -> KevyResult<usize>
pub fn llen(&mut self, key: &[u8]) -> KevyResult<usize>
LLEN key.
Sourcepub fn scard(&mut self, key: &[u8]) -> KevyResult<usize>
pub fn scard(&mut self, key: &[u8]) -> KevyResult<usize>
SCARD key.
Sourcepub fn zrangebyscore(
&mut self,
key: &[u8],
min: ScoreBound,
max: ScoreBound,
) -> KevyResult<Vec<(Vec<u8>, f64)>>
pub fn zrangebyscore( &mut self, key: &[u8], min: ScoreBound, max: ScoreBound, ) -> KevyResult<Vec<(Vec<u8>, f64)>>
ZRANGEBYSCORE key min max.
Source§impl AtomicAllShards<'_>
impl AtomicAllShards<'_>
Sourcepub fn idx_query(
&mut self,
name: &[u8],
min: &IndexValue,
max: &IndexValue,
cursor: Option<&Cursor>,
limit: usize,
) -> KevyResult<IndexPage>
pub fn idx_query( &mut self, name: &[u8], min: &IndexValue, max: &IndexValue, cursor: Option<&Cursor>, limit: usize, ) -> KevyResult<IndexPage>
IDX.QUERY name min max — range or EQ, merged across every
shard in (value, key) order.
Sees the index as of the last commit; see the module note.
Sourcepub fn idx_count(
&mut self,
name: &[u8],
min: &IndexValue,
max: &IndexValue,
) -> KevyResult<u64>
pub fn idx_count( &mut self, name: &[u8], min: &IndexValue, max: &IndexValue, ) -> KevyResult<u64>
IDX.COUNT name min max without materialising keys — the cheap
form of an existence check.