Trait BitmapCommands

Source
pub trait BitmapCommands<'a> {
    // Provided methods
    fn bitcount<K>(
        self,
        key: K,
        range: BitRange,
    ) -> PreparedCommand<'a, Self, usize>
       where Self: Sized,
             K: SingleArg { ... }
    fn bitfield<K, C, E, O>(
        self,
        key: K,
        sub_commands: C,
    ) -> PreparedCommand<'a, Self, Vec<u64>>
       where Self: Sized,
             K: SingleArg,
             E: SingleArg,
             O: SingleArg,
             C: MultipleArgsCollection<BitFieldSubCommand<E, O>> { ... }
    fn bitfield_readonly<K, C, E, O>(
        self,
        key: K,
        get_commands: C,
    ) -> PreparedCommand<'a, Self, Vec<u64>>
       where Self: Sized,
             K: SingleArg,
             E: SingleArg,
             O: SingleArg,
             C: MultipleArgsCollection<BitFieldGetSubCommand<E, O>> { ... }
    fn bitop<D, K, KK>(
        self,
        operation: BitOperation,
        dest_key: D,
        keys: KK,
    ) -> PreparedCommand<'a, Self, usize>
       where Self: Sized,
             D: SingleArg,
             K: SingleArg,
             KK: SingleArgCollection<K> { ... }
    fn bitpos<K>(
        self,
        key: K,
        bit: u64,
        range: BitRange,
    ) -> PreparedCommand<'a, Self, usize>
       where Self: Sized,
             K: SingleArg { ... }
    fn getbit<K>(self, key: K, offset: u64) -> PreparedCommand<'a, Self, u64>
       where Self: Sized,
             K: SingleArg { ... }
    fn setbit<K>(
        self,
        key: K,
        offset: u64,
        value: u64,
    ) -> PreparedCommand<'a, Self, u64>
       where Self: Sized,
             K: SingleArg { ... }
}
Expand description

A group of Redis commands related to Bitmaps & Bitfields

§See Also

Redis Generic Commands

Provided Methods§

Source

fn bitcount<K>( self, key: K, range: BitRange, ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg,

Count the number of set bits (population counting) in a string.

§Return

The number of bits set to 1.

§See Also

https://redis.io/commands/bitcount/

Source

fn bitfield<K, C, E, O>( self, key: K, sub_commands: C, ) -> PreparedCommand<'a, Self, Vec<u64>>

The command treats a Redis string as an array of bits, and is capable of addressing specific integer fields of varying bit widths and arbitrary non (necessary) aligned offset.

§Return

A collection with each entry being the corresponding result of the sub command given at the same position. OVERFLOW subcommands don’t count as generating a reply.

§See Also

https://redis.io/commands/bitfield/

Source

fn bitfield_readonly<K, C, E, O>( self, key: K, get_commands: C, ) -> PreparedCommand<'a, Self, Vec<u64>>

Read-only variant of the BITFIELD command. It is like the original BITFIELD but only accepts GET subcommand and can safely be used in read-only replicas.

§Return

A collection with each entry being the corresponding result of the sub command given at the same position.

§See Also

https://redis.io/commands/bitfield_ro/

Source

fn bitop<D, K, KK>( self, operation: BitOperation, dest_key: D, keys: KK, ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, D: SingleArg, K: SingleArg, KK: SingleArgCollection<K>,

Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key.

§Return

The size of the string stored in the destination key, that is equal to the size of the longest input string.

§See Also

https://redis.io/commands/bitop/

Source

fn bitpos<K>( self, key: K, bit: u64, range: BitRange, ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg,

Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination key.

§Return

The position of the first bit set to 1 or 0 according to the request.

§See Also

https://redis.io/commands/bitpos/

Source

fn getbit<K>(self, key: K, offset: u64) -> PreparedCommand<'a, Self, u64>
where Self: Sized, K: SingleArg,

Returns the bit value at offset in the string value stored at key.

§Return

The bit value stored at offset.

§See Also

https://redis.io/commands/getbit/

Source

fn setbit<K>( self, key: K, offset: u64, value: u64, ) -> PreparedCommand<'a, Self, u64>
where Self: Sized, K: SingleArg,

Sets or clears the bit at offset in the string value stored at key.

§Return

The original bit value stored at offset.

§See Also

https://redis.io/commands/setbit/

Implementors§

Source§

impl<'a> BitmapCommands<'a> for &'a Client

Source§

impl<'a> BitmapCommands<'a> for &'a mut Transaction

Source§

impl<'a, 'b> BitmapCommands<'a> for &'a mut Pipeline<'b>