redis_streams/
lib.rs

1//! `redis-streams-rs` exposes the [Redis Stream](https://redis.io/commands#stream)
2//! functionality as a Trait on top of [`redis-rs`](https://github.com/mitsuhiko/redis-rs).
3//!
4//! The crate is called `redis_streams`.
5//!
6//! In order to you use this crate, you'll first want to add it as a github
7//! dependency (until I have a chance to publish on crates.io).
8//!
9//! ```ini
10//! [dependencies.redis_streams]
11//! git = "https://github.com/grippy/redis-streams-rs.git"
12//! ```
13//!
14//! From here, just unlock the streaming commands prior to instantiating client connections.
15//!
16//! ```no_run
17//! use redis_streams::{client_open,Connection,StreamCommands};
18//! let client = client_open("redis://127.0.0.1/0").unwrap();
19//! let mut con = client.get_connection().unwrap();
20//! ```
21//!
22//! This crate also exposes all top-level `redis-rs` types.
23//! To pick up all `redis-rs` Commands, just use the `Commands` trait.
24//!
25//! ```no_run
26//! use redis_streams::{Commands};
27//! ```
28//!
29#![deny(non_camel_case_types)]
30
31#[doc(hidden)]
32pub use redis::{
33    Client, Commands, Connection, ErrorKind, FromRedisValue, RedisError, RedisResult, ToRedisArgs,
34    Value,
35};
36
37pub use crate::commands::StreamCommands;
38
39pub use crate::types::{
40    // stream types
41    StreamClaimOptions,
42    StreamClaimReply,
43    StreamId,
44    StreamInfoConsumer,
45    StreamInfoConsumersReply,
46    StreamInfoGroup,
47    StreamInfoGroupsReply,
48    StreamInfoStreamReply,
49    StreamKey,
50    StreamMaxlen,
51    StreamPendingCountReply,
52    StreamPendingData,
53    StreamPendingId,
54    StreamPendingReply,
55    StreamRangeReply,
56    StreamReadOptions,
57    StreamReadReply,
58};
59
60mod commands;
61mod types;
62
63/// Curry `redis::Client::open` calls.
64///
65pub fn client_open<T: redis::IntoConnectionInfo>(params: T) -> redis::RedisResult<redis::Client> {
66    redis::Client::open(params)
67}