redis_async/client/mod.rs
1/*
2 * Copyright 2017-2020 Ben Ashford
3 *
4 * Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5 * http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 * <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7 * option. This file may not be copied, modified, or distributed
8 * except according to those terms.
9 */
10
11//! The client API itself.
12//!
13//! This contains three main functions that return three specific types of client:
14//!
15//! * `connect` returns a pair of `Stream` and `Sink`, clients can write RESP messages to the
16//! `Sink` and read RESP messages from the `Stream`. Pairing requests to responses is up to the
17//! client. This is intended to be a low-level interface from which more user-friendly interfaces
18//! can be built.
19//! * `paired_connect` is used for most of the standard Redis commands, where one request results
20//! in one response.
21//! * `pubsub_connect` is used for Redis's PUBSUB functionality.
22
23pub mod connect;
24#[macro_use]
25pub mod paired;
26mod builder;
27pub mod pubsub;
28
29pub use self::connect::connect;
30#[cfg(feature = "tls")]
31pub use self::connect::connect_tls;
32
33pub use self::{
34 builder::ConnectionBuilder,
35 paired::{paired_connect, PairedConnection},
36 pubsub::{pubsub_connect, PubsubConnection},
37};