Trait rustis::commands::StreamCommands

source ·
pub trait StreamCommands<'a> {
Show 21 methods // Provided methods fn xack<K, G, I, II>( self, key: K, group: G, ids: II ) -> PreparedCommand<'a, Self, usize> where Self: Sized, K: SingleArg, G: SingleArg, I: SingleArg, II: SingleArgCollection<I> { ... } fn xadd<K, I, F, V, FFVV, R>( self, key: K, stream_id: I, items: FFVV, options: XAddOptions ) -> PreparedCommand<'a, Self, R> where Self: Sized, K: SingleArg, I: SingleArg, F: SingleArg, V: SingleArg, FFVV: KeyValueArgsCollection<F, V>, R: PrimitiveResponse { ... } fn xautoclaim<K, G, C, I, V>( self, key: K, group: G, consumer: C, min_idle_time: u64, start: I, options: XAutoClaimOptions ) -> PreparedCommand<'a, Self, XAutoClaimResult<V>> where Self: Sized, K: SingleArg, G: SingleArg, C: SingleArg, I: SingleArg, V: PrimitiveResponse + DeserializeOwned { ... } fn xclaim<K, G, C, I, II, V>( self, key: K, group: G, consumer: C, min_idle_time: u64, ids: II, options: XClaimOptions ) -> PreparedCommand<'a, Self, Vec<StreamEntry<V>>> where Self: Sized, K: SingleArg, G: SingleArg, C: SingleArg, I: SingleArg, II: SingleArgCollection<I>, V: PrimitiveResponse + DeserializeOwned { ... } fn xdel<K, I, II>(self, key: K, ids: II) -> PreparedCommand<'a, Self, usize> where Self: Sized, K: SingleArg, I: SingleArg, II: SingleArgCollection<I> { ... } fn xgroup_create<K, G, I>( self, key: K, groupname: G, id: I, options: XGroupCreateOptions ) -> PreparedCommand<'a, Self, bool> where Self: Sized, K: SingleArg, G: SingleArg, I: SingleArg { ... } fn xgroup_createconsumer<K, G, C>( self, key: K, groupname: G, consumername: C ) -> PreparedCommand<'a, Self, bool> where Self: Sized, K: SingleArg, G: SingleArg, C: SingleArg { ... } fn xgroup_delconsumer<K, G, C>( self, key: K, groupname: G, consumername: C ) -> PreparedCommand<'a, Self, usize> where Self: Sized, K: SingleArg, G: SingleArg, C: SingleArg { ... } fn xgroup_destroy<K, G>( self, key: K, groupname: G ) -> PreparedCommand<'a, Self, bool> where Self: Sized, K: SingleArg, G: SingleArg { ... } fn xgroup_setid<K, G, I>( self, key: K, groupname: G, id: I, entries_read: Option<usize> ) -> PreparedCommand<'a, Self, ()> where Self: Sized, K: SingleArg, G: SingleArg, I: SingleArg { ... } fn xinfo_consumers<K, G>( self, key: K, groupname: G ) -> PreparedCommand<'a, Self, Vec<XConsumerInfo>> where Self: Sized, K: SingleArg, G: SingleArg { ... } fn xinfo_groups<K>( self, key: K ) -> PreparedCommand<'a, Self, Vec<XGroupInfo>> where Self: Sized, K: SingleArg { ... } fn xinfo_stream<K>( self, key: K, options: XInfoStreamOptions ) -> PreparedCommand<'a, Self, XStreamInfo> where Self: Sized, K: SingleArg { ... } fn xlen<K>(self, key: K) -> PreparedCommand<'a, Self, usize> where Self: Sized, K: SingleArg { ... } fn xpending<K, G>( self, key: K, group: G ) -> PreparedCommand<'a, Self, XPendingResult> where Self: Sized, K: SingleArg, G: SingleArg { ... } fn xpending_with_options<K, G>( self, key: K, group: G, options: XPendingOptions ) -> PreparedCommand<'a, Self, Vec<XPendingMessageResult>> where Self: Sized, K: SingleArg, G: SingleArg { ... } fn xrange<K, S, E, V>( self, key: K, start: S, end: E, count: Option<usize> ) -> PreparedCommand<'a, Self, Vec<StreamEntry<V>>> where Self: Sized, K: SingleArg, S: SingleArg, E: SingleArg, V: PrimitiveResponse + DeserializeOwned { ... } fn xread<K, KK, I, II, V, R>( self, options: XReadOptions, keys: KK, ids: II ) -> PreparedCommand<'a, Self, R> where Self: Sized, K: SingleArg, KK: SingleArgCollection<K>, I: SingleArg, II: SingleArgCollection<I>, V: PrimitiveResponse + DeserializeOwned, R: KeyValueCollectionResponse<String, Vec<StreamEntry<V>>> { ... } fn xreadgroup<G, C, K, KK, I, II, V, R>( self, group: G, consumer: C, options: XReadGroupOptions, keys: KK, ids: II ) -> PreparedCommand<'a, Self, R> where Self: Sized, G: SingleArg, C: SingleArg, K: SingleArg, KK: SingleArgCollection<K>, I: SingleArg, II: SingleArgCollection<I>, V: PrimitiveResponse + DeserializeOwned, R: KeyValueCollectionResponse<String, Vec<StreamEntry<V>>> { ... } fn xrevrange<K, E, S, V>( self, key: K, end: E, start: S, count: Option<usize> ) -> PreparedCommand<'a, Self, Vec<StreamEntry<V>>> where Self: Sized, K: SingleArg, E: SingleArg, S: SingleArg, V: PrimitiveResponse + DeserializeOwned { ... } fn xtrim<K>( self, key: K, options: XTrimOptions ) -> PreparedCommand<'a, Self, usize> where Self: Sized, K: SingleArg { ... }
}
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>( self, key: K, group: G, ids: II ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, G: SingleArg, I: SingleArg, II: SingleArgCollection<I>,

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>( self, key: K, stream_id: I, items: FFVV, options: XAddOptions ) -> PreparedCommand<'a, 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>( self, key: K, group: G, consumer: C, min_idle_time: u64, start: I, options: XAutoClaimOptions ) -> PreparedCommand<'a, 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>( self, key: K, group: G, consumer: C, min_idle_time: u64, ids: II, options: XClaimOptions ) -> PreparedCommand<'a, 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>(self, key: K, ids: II) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, I: SingleArg, II: SingleArgCollection<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>( self, key: K, groupname: G, id: I, options: XGroupCreateOptions ) -> PreparedCommand<'a, Self, bool>
where Self: Sized, K: SingleArg, G: SingleArg, I: SingleArg,

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

§Return
  • true success
  • falsefailure
§See Also

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

source

fn xgroup_createconsumer<K, G, C>( self, key: K, groupname: G, consumername: C ) -> PreparedCommand<'a, Self, bool>
where Self: Sized, K: SingleArg, G: SingleArg, C: SingleArg,

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>( self, key: K, groupname: G, consumername: C ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg, G: SingleArg, C: SingleArg,

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>( self, key: K, groupname: G ) -> PreparedCommand<'a, Self, bool>
where Self: Sized, K: SingleArg, G: SingleArg,

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>( self, key: K, groupname: G, id: I, entries_read: Option<usize> ) -> PreparedCommand<'a, Self, ()>
where Self: Sized, K: SingleArg, G: SingleArg, I: SingleArg,

Set the last delivered ID for a consumer group.

§See Also

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

source

fn xinfo_consumers<K, G>( self, key: K, groupname: G ) -> PreparedCommand<'a, Self, Vec<XConsumerInfo>>
where Self: Sized, K: SingleArg, G: SingleArg,

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>(self, key: K) -> PreparedCommand<'a, Self, Vec<XGroupInfo>>
where Self: Sized, K: SingleArg,

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>( self, key: K, options: XInfoStreamOptions ) -> PreparedCommand<'a, Self, XStreamInfo>
where Self: Sized, K: SingleArg,

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>(self, key: K) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg,

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>( self, key: K, group: G ) -> PreparedCommand<'a, Self, XPendingResult>
where Self: Sized, K: SingleArg, G: SingleArg,

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>( self, key: K, group: G, options: XPendingOptions ) -> PreparedCommand<'a, Self, Vec<XPendingMessageResult>>
where Self: Sized, K: SingleArg, G: SingleArg,

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>( self, key: K, start: S, end: E, count: Option<usize> ) -> PreparedCommand<'a, Self, Vec<StreamEntry<V>>>

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>( self, options: XReadOptions, keys: KK, ids: II ) -> PreparedCommand<'a, 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>( self, group: G, consumer: C, options: XReadGroupOptions, keys: KK, ids: II ) -> PreparedCommand<'a, 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>( self, key: K, end: E, start: S, count: Option<usize> ) -> PreparedCommand<'a, Self, Vec<StreamEntry<V>>>

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>( self, key: K, options: XTrimOptions ) -> PreparedCommand<'a, Self, usize>
where Self: Sized, K: SingleArg,

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§

source§

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

source§

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

source§

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