Trait StreamCommands

Source
pub trait StreamCommands {
Show 21 methods // Provided methods fn xack<K, G, I, II>( &mut self, key: K, group: G, ids: II, ) -> PreparedCommand<'_, Self, usize> where Self: Sized, K: Into<CommandArg>, G: Into<CommandArg>, I: Into<CommandArg>, 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<CommandArg>, I: Into<CommandArg>, F: Into<CommandArg>, V: Into<CommandArg>, 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<CommandArg>, G: Into<CommandArg>, C: Into<CommandArg>, I: Into<CommandArg>, 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<CommandArg>, G: Into<CommandArg>, C: Into<CommandArg>, I: Into<CommandArg>, II: SingleArgOrCollection<I>, V: FromValue { ... } fn xdel<K, I, II>( &mut self, key: K, ids: II, ) -> PreparedCommand<'_, Self, usize> where Self: Sized, K: Into<CommandArg>, I: Into<CommandArg>, 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<CommandArg>, G: Into<CommandArg>, I: Into<CommandArg> { ... } fn xgroup_createconsumer<K, G, C>( &mut self, key: K, groupname: G, consumername: C, ) -> PreparedCommand<'_, Self, bool> where Self: Sized, K: Into<CommandArg>, G: Into<CommandArg>, C: Into<CommandArg> { ... } fn xgroup_delconsumer<K, G, C>( &mut self, key: K, groupname: G, consumername: C, ) -> PreparedCommand<'_, Self, usize> where Self: Sized, K: Into<CommandArg>, G: Into<CommandArg>, C: Into<CommandArg> { ... } fn xgroup_destroy<K, G>( &mut self, key: K, groupname: G, ) -> PreparedCommand<'_, Self, bool> where Self: Sized, K: Into<CommandArg>, G: Into<CommandArg> { ... } 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<CommandArg>, G: Into<CommandArg>, I: Into<CommandArg> { ... } fn xinfo_consumers<K, G>( &mut self, key: K, groupname: G, ) -> PreparedCommand<'_, Self, Vec<XConsumerInfo>> where Self: Sized, K: Into<CommandArg>, G: Into<CommandArg> { ... } fn xinfo_groups<K>( &mut self, key: K, ) -> PreparedCommand<'_, Self, Vec<XGroupInfo>> where Self: Sized, K: Into<CommandArg> { ... } fn xinfo_stream<K>( &mut self, key: K, options: XInfoStreamOptions, ) -> PreparedCommand<'_, Self, XStreamInfo> where Self: Sized, K: Into<CommandArg> { ... } fn xlen<K>(&mut self, key: K) -> PreparedCommand<'_, Self, usize> where Self: Sized, K: Into<CommandArg> { ... } fn xpending<K, G>( &mut self, key: K, group: G, ) -> PreparedCommand<'_, Self, XPendingResult> where Self: Sized, K: Into<CommandArg>, G: Into<CommandArg> { ... } fn xpending_with_options<K, G>( &mut self, key: K, group: G, options: XPendingOptions, ) -> PreparedCommand<'_, Self, Vec<XPendingMessageResult>> where Self: Sized, K: Into<CommandArg>, G: Into<CommandArg> { ... } 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<CommandArg>, S: Into<CommandArg>, E: Into<CommandArg>, 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<CommandArg>, KK: SingleArgOrCollection<K>, I: Into<CommandArg>, 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<CommandArg>, C: Into<CommandArg>, K: Into<CommandArg>, KK: SingleArgOrCollection<K>, I: Into<CommandArg>, 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<CommandArg>, E: Into<CommandArg>, S: Into<CommandArg>, V: FromValue { ... } fn xtrim<K>( &mut self, key: K, options: XTrimOptions, ) -> PreparedCommand<'_, Self, usize> where Self: Sized, K: Into<CommandArg> { ... }
}
Expand description

A group of Redis commands related to Streams

§See Also

Redis Generic Commands Streams tutorial

Provided Methods§

Source

fn xack<K, G, I, II>( &mut self, key: K, group: G, ids: II, ) -> PreparedCommand<'_, Self, usize>

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/

Source

fn xadd<K, I, F, V, FFVV, R>( &mut self, key: K, stream_id: I, items: FFVV, options: XAddOptions, ) -> PreparedCommand<'_, Self, R>

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/

Source

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>>

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/

Source

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>>>

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/

Source

fn xdel<K, I, II>( &mut self, key: K, ids: II, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, I: Into<CommandArg>, II: SingleArgOrCollection<I>,

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/

Source

fn xgroup_create<K, G, I>( &mut self, key: K, groupname: G, id: I, options: XGroupCreateOptions, ) -> PreparedCommand<'_, Self, bool>
where Self: Sized, K: Into<CommandArg>, G: Into<CommandArg>, I: Into<CommandArg>,

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/

Source

fn xgroup_createconsumer<K, G, C>( &mut self, key: K, groupname: G, consumername: C, ) -> PreparedCommand<'_, Self, bool>
where Self: Sized, K: Into<CommandArg>, G: Into<CommandArg>, C: Into<CommandArg>,

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/

Source

fn xgroup_delconsumer<K, G, C>( &mut self, key: K, groupname: G, consumername: C, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>, G: Into<CommandArg>, C: Into<CommandArg>,

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/

Source

fn xgroup_destroy<K, G>( &mut self, key: K, groupname: G, ) -> PreparedCommand<'_, Self, bool>
where Self: Sized, K: Into<CommandArg>, G: Into<CommandArg>,

The XGROUP DESTROY command completely destroys a consumer group.

§Return
  • true success
  • falsefailure
§See Also

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

Source

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<CommandArg>, G: Into<CommandArg>, I: Into<CommandArg>,

Set the last delivered ID for a consumer group.

§See Also

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

Source

fn xinfo_consumers<K, G>( &mut self, key: K, groupname: G, ) -> PreparedCommand<'_, Self, Vec<XConsumerInfo>>
where Self: Sized, K: Into<CommandArg>, G: Into<CommandArg>,

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/

Source

fn xinfo_groups<K>( &mut self, key: K, ) -> PreparedCommand<'_, Self, Vec<XGroupInfo>>
where Self: Sized, K: Into<CommandArg>,

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/

Source

fn xinfo_stream<K>( &mut self, key: K, options: XInfoStreamOptions, ) -> PreparedCommand<'_, Self, XStreamInfo>
where Self: Sized, K: Into<CommandArg>,

This command returns information about the stream stored at key.

§Return

A collection of XGroupInfo.

§See Also

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

Source

fn xlen<K>(&mut self, key: K) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>,

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/

Source

fn xpending<K, G>( &mut self, key: K, group: G, ) -> PreparedCommand<'_, Self, XPendingResult>
where Self: Sized, K: Into<CommandArg>, G: Into<CommandArg>,

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

§See Also

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

Source

fn xpending_with_options<K, G>( &mut self, key: K, group: G, options: XPendingOptions, ) -> PreparedCommand<'_, Self, Vec<XPendingMessageResult>>
where Self: Sized, K: Into<CommandArg>, G: Into<CommandArg>,

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

§See Also

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

Source

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<CommandArg>, S: Into<CommandArg>, E: Into<CommandArg>, V: FromValue,

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/

Source

fn xread<K, KK, I, II, V, R>( &mut self, options: XReadOptions, keys: KK, ids: II, ) -> PreparedCommand<'_, Self, R>

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/

Source

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>

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/

Source

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<CommandArg>, E: Into<CommandArg>, S: Into<CommandArg>, V: FromValue,

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/

Source

fn xtrim<K>( &mut self, key: K, options: XTrimOptions, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, K: Into<CommandArg>,

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§