pub trait StreamCommands {
Show 21 methods fn xack<K, G, I, II>(
        &mut self,
        key: K,
        group: G,
        ids: II
    ) -> PreparedCommand<'_, Self, usize>
    where
        Self: Sized,
        K: Into<BulkString>,
        G: Into<BulkString>,
        I: Into<BulkString>,
        II: SingleArgOrCollection<I>
, { ... } fn xadd<K, I, F, V, FFVV, R>(
        &mut self,
        key: K,
        stream_id: I,
        items: FFVV,
        options: XAddOptions
    ) -> PreparedCommand<'_, Self, R>
    where
        Self: Sized,
        K: Into<BulkString>,
        I: Into<BulkString>,
        F: Into<BulkString>,
        V: Into<BulkString>,
        FFVV: KeyValueArgOrCollection<F, V>,
        R: FromValue
, { ... } fn xautoclaim<K, G, C, I, V>(
        &mut self,
        key: K,
        group: G,
        consumer: C,
        min_idle_time: u64,
        start: I,
        options: XAutoClaimOptions
    ) -> PreparedCommand<'_, Self, XAutoClaimResult<V>>
    where
        Self: Sized,
        K: Into<BulkString>,
        G: Into<BulkString>,
        C: Into<BulkString>,
        I: Into<BulkString>,
        V: FromValue
, { ... } fn xclaim<K, G, C, I, II, V>(
        &mut self,
        key: K,
        group: G,
        consumer: C,
        min_idle_time: u64,
        ids: II,
        options: XClaimOptions
    ) -> PreparedCommand<'_, Self, Vec<StreamEntry<V>>>
    where
        Self: Sized,
        K: Into<BulkString>,
        G: Into<BulkString>,
        C: Into<BulkString>,
        I: Into<BulkString>,
        II: SingleArgOrCollection<I>,
        V: FromValue
, { ... } fn xdel<K, I, II>(
        &mut self,
        key: K,
        ids: II
    ) -> PreparedCommand<'_, Self, usize>
    where
        Self: Sized,
        K: Into<BulkString>,
        I: Into<BulkString>,
        II: SingleArgOrCollection<I>
, { ... } fn xgroup_create<K, G, I>(
        &mut self,
        key: K,
        groupname: G,
        id: I,
        options: XGroupCreateOptions
    ) -> PreparedCommand<'_, Self, bool>
    where
        Self: Sized,
        K: Into<BulkString>,
        G: Into<BulkString>,
        I: Into<BulkString>
, { ... } fn xgroup_createconsumer<K, G, C>(
        &mut self,
        key: K,
        groupname: G,
        consumername: C
    ) -> PreparedCommand<'_, Self, bool>
    where
        Self: Sized,
        K: Into<BulkString>,
        G: Into<BulkString>,
        C: Into<BulkString>
, { ... } fn xgroup_delconsumer<K, G, C>(
        &mut self,
        key: K,
        groupname: G,
        consumername: C
    ) -> PreparedCommand<'_, Self, usize>
    where
        Self: Sized,
        K: Into<BulkString>,
        G: Into<BulkString>,
        C: Into<BulkString>
, { ... } fn xgroup_destroy<K, G>(
        &mut self,
        key: K,
        groupname: G
    ) -> PreparedCommand<'_, Self, bool>
    where
        Self: Sized,
        K: Into<BulkString>,
        G: Into<BulkString>
, { ... } fn xgroup_setid<K, G, I>(
        &mut self,
        key: K,
        groupname: G,
        id: I,
        entries_read: Option<usize>
    ) -> PreparedCommand<'_, Self, ()>
    where
        Self: Sized,
        K: Into<BulkString>,
        G: Into<BulkString>,
        I: Into<BulkString>
, { ... } fn xinfo_consumers<K, G>(
        &mut self,
        key: K,
        groupname: G
    ) -> PreparedCommand<'_, Self, Vec<XConsumerInfo>>
    where
        Self: Sized,
        K: Into<BulkString>,
        G: Into<BulkString>
, { ... } fn xinfo_groups<K>(
        &mut self,
        key: K
    ) -> PreparedCommand<'_, Self, Vec<XGroupInfo>>
    where
        Self: Sized,
        K: Into<BulkString>
, { ... } fn xinfo_stream<K>(
        &mut self,
        key: K,
        options: XInfoStreamOptions
    ) -> PreparedCommand<'_, Self, XStreamInfo>
    where
        Self: Sized,
        K: Into<BulkString>
, { ... } fn xlen<K>(&mut self, key: K) -> PreparedCommand<'_, Self, usize>
    where
        Self: Sized,
        K: Into<BulkString>
, { ... } fn xpending<K, G>(
        &mut self,
        key: K,
        group: G
    ) -> PreparedCommand<'_, Self, XPendingResult>
    where
        Self: Sized,
        K: Into<BulkString>,
        G: Into<BulkString>
, { ... } fn xpending_with_options<K, G>(
        &mut self,
        key: K,
        group: G,
        options: XPendingOptions
    ) -> PreparedCommand<'_, Self, Vec<XPendingMessageResult>>
    where
        Self: Sized,
        K: Into<BulkString>,
        G: Into<BulkString>
, { ... } fn xrange<K, S, E, V>(
        &mut self,
        key: K,
        start: S,
        end: E,
        count: Option<usize>
    ) -> PreparedCommand<'_, Self, Vec<StreamEntry<V>>>
    where
        Self: Sized,
        K: Into<BulkString>,
        S: Into<BulkString>,
        E: Into<BulkString>,
        V: FromValue
, { ... } fn xread<K, KK, I, II, V, R>(
        &mut self,
        options: XReadOptions,
        keys: KK,
        ids: II
    ) -> PreparedCommand<'_, Self, R>
    where
        Self: Sized,
        K: Into<BulkString>,
        KK: SingleArgOrCollection<K>,
        I: Into<BulkString>,
        II: SingleArgOrCollection<I>,
        V: FromValue,
        R: FromKeyValueValueArray<String, Vec<StreamEntry<V>>>
, { ... } fn xreadgroup<G, C, K, KK, I, II, V, R>(
        &mut self,
        group: G,
        consumer: C,
        options: XReadGroupOptions,
        keys: KK,
        ids: II
    ) -> PreparedCommand<'_, Self, R>
    where
        Self: Sized,
        G: Into<BulkString>,
        C: Into<BulkString>,
        K: Into<BulkString>,
        KK: SingleArgOrCollection<K>,
        I: Into<BulkString>,
        II: SingleArgOrCollection<I>,
        V: FromValue,
        R: FromKeyValueValueArray<String, Vec<StreamEntry<V>>>
, { ... } fn xrevrange<K, E, S, V>(
        &mut self,
        key: K,
        end: E,
        start: S,
        count: Option<usize>
    ) -> PreparedCommand<'_, Self, Vec<StreamEntry<V>>>
    where
        Self: Sized,
        K: Into<BulkString>,
        E: Into<BulkString>,
        S: Into<BulkString>,
        V: FromValue
, { ... } fn xtrim<K>(
        &mut self,
        key: K,
        options: XTrimOptions
    ) -> PreparedCommand<'_, Self, usize>
    where
        Self: Sized,
        K: Into<BulkString>
, { ... }
}
Expand description

A group of Redis commands related to Streams

See Also

Redis Generic Commands Streams tutorial

Provided Methods

The XACK command removes one or multiple messages from the Pending Entries List (PEL) of a stream consumer group

Return

The command returns the number of messages successfully acknowledged. Certain message IDs may no longer be part of the PEL (for example because they have already been acknowledged), and XACK will not count them as successfully acknowledged.

See Also

https://redis.io/commands/xack/

Appends the specified stream entry to the stream at the specified key.

Return

the ID of the added entry.

The ID is the one auto-generated if * is passed as ID argument, otherwise the command just returns the same ID specified by the user during insertion.

The command returns a Null reply when used with create_stream=false and the key doesn’t exist.

See Also

https://redis.io/commands/xadd/

This command transfers ownership of pending stream entries that match the specified criteria.

Return

An instance of StreamAutoClaimResult

See Also

https://redis.io/commands/xautoclaim/

In the context of a stream consumer group, this command changes the ownership of a pending message, so that the new owner is the consumer specified as the command argument.

Return

The ID of the added entry.

The ID is the one auto-generated if * is passed as ID argument, otherwise the command just returns the same ID specified by the user during insertion.

The command returns a Null reply when used with create_stream=false and the key doesn’t exist.

See Also

https://redis.io/commands/xclaim/

Removes the specified entries from a stream, and returns the number of entries deleted.

Return

The number of entries actually deleted.

See Also

https://redis.io/commands/xdel/

This command creates a new consumer group uniquely identified by for the stream stored at .

Return
  • true success
  • falsefailure
See Also

https://redis.io/commands/xgroup-create/

Create a consumer named consumername in the consumer group groupname`` of the stream that's stored at key.

Return
  • true success
  • falsefailure
See Also

https://redis.io/commands/xgroup-createconsumer/

The XGROUP DELCONSUMER command deletes a consumer from the consumer group.

Return

The number of pending messages that the consumer had before it was deleted

See Also

https://redis.io/commands/xgroup-delconsumer/

The XGROUP DESTROY command completely destroys a consumer group.

Return
  • true success
  • falsefailure
See Also

https://redis.io/commands/xgroup-destroy/

Set the last delivered ID for a consumer group.

See Also

https://redis.io/commands/xgroup-setid/

This command returns the list of consumers that belong to the groupname consumer group of the stream stored at key.

Return

A collection of XConsumerInfo.

See Also

https://redis.io/commands/xinfo-consumers/

This command returns the list of consumers that belong to the groupname consumer group of the stream stored at key.

Return

A collection of XGroupInfo.

See Also

https://redis.io/commands/xinfo-groups/

This command returns information about the stream stored at key.

Return

A collection of XGroupInfo.

See Also

https://redis.io/commands/xinfo-stream/

Returns the number of entries inside a stream.

Return

The number of entries of the stream at key.

See Also

https://redis.io/commands/xrange/

The XPENDING command is the interface to inspect the list of pending messages.

See Also

https://redis.io/commands/xpending/

The XPENDING command is the interface to inspect the list of pending messages.

See Also

https://redis.io/commands/xpending/

The command returns the stream entries matching a given range of IDs.

Return

A collection of StreamEntry

The command returns the entries with IDs matching the specified range. The returned entries are complete, that means that the ID and all the fields they are composed are returned. Moreover, the entries are returned with their fields and values in the exact same order as XADD added them.

See Also

https://redis.io/commands/xrange/

Read data from one or multiple streams, only returning entries with an ID greater than the last received ID reported by the caller.

Return

A collection of XReadStreamResult

See Also

https://redis.io/commands/xread/

The XREADGROUP command is a special version of the xread command with support for consumer groups.

Return

A collection of XReadStreamResult

See Also

https://redis.io/commands/xreadgroup/

This command is exactly like xrange, but with the notable difference of returning the entries in reverse order, and also taking the start-end range in reverse order

Return

A collection of StreamEntry

See Also

https://redis.io/commands/xrevrange/

XTRIM trims the stream by evicting older entries (entries with lower IDs) if needed.

Return

The number of entries deleted from the stream.

See Also

https://redis.io/commands/xtrim/

Implementors