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

#[doc(hidden)]
pub use redis::{
    Client, Commands, Connection, ErrorKind, FromRedisValue, RedisError, RedisResult, ToRedisArgs,
    Value,
};

pub use crate::commands::StreamCommands;

pub use crate::types::{
    // stream types
    StreamClaimOptions,
    StreamClaimReply,
    StreamId,
    StreamInfoConsumer,
    StreamInfoConsumersReply,
    StreamInfoGroup,
    StreamInfoGroupsReply,
    StreamInfoStreamReply,
    StreamKey,
    StreamMaxlen,
    StreamPendingCountReply,
    StreamPendingData,
    StreamPendingId,
    StreamPendingReply,
    StreamRangeReply,
    StreamReadOptions,
    StreamReadReply,
};

mod commands;
mod types;

/// Curry `redis::Client::open` calls.
///
pub fn client_open<T: redis::IntoConnectionInfo>(params: T) -> redis::RedisResult<redis::Client> {
    redis::Client::open(params)
}