Trait fred::interfaces::HyperloglogInterface

source ·
pub trait HyperloglogInterface: ClientLike + Sized {
    // Provided methods
    fn pfadd<R, K, V>(
        &self,
        key: K,
        elements: V,
    ) -> impl Future<Output = RedisResult<R>>
       where R: FromRedis,
             K: Into<RedisKey>,
             V: TryInto<MultipleValues>,
             V::Error: Into<RedisError> { ... }
    fn pfcount<R, K>(&self, keys: K) -> impl Future<Output = RedisResult<R>>
       where R: FromRedis,
             K: Into<MultipleKeys> { ... }
    fn pfmerge<R, D, S>(
        &self,
        dest: D,
        sources: S,
    ) -> impl Future<Output = RedisResult<R>>
       where R: FromRedis,
             D: Into<RedisKey>,
             S: Into<MultipleKeys> { ... }
}
Available on crate feature i-hyperloglog only.
Expand description

Functions that implement the HyperLogLog interface.

Provided Methods§

source

fn pfadd<R, K, V>( &self, key: K, elements: V, ) -> impl Future<Output = RedisResult<R>>

Adds all the element arguments to the HyperLogLog data structure stored at the variable name specified as first argument.

https://redis.io/commands/pfadd

source

fn pfcount<R, K>(&self, keys: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<MultipleKeys>,

When called with a single key, returns the approximated cardinality computed by the HyperLogLog data structure stored at the specified variable, which is 0 if the variable does not exist.

When called with multiple keys, returns the approximated cardinality of the union of the HyperLogLogs passed, by internally merging the HyperLogLogs stored at the provided keys into a temporary HyperLogLog.

https://redis.io/commands/pfcount

source

fn pfmerge<R, D, S>( &self, dest: D, sources: S, ) -> impl Future<Output = RedisResult<R>>

Merge multiple HyperLogLog values into an unique value that will approximate the cardinality of the union of the observed sets of the source HyperLogLog structures.

https://redis.io/commands/pfmerge

Object Safety§

This trait is not object safe.

Implementors§