2018-02-17 21:37:30 +03:00
|
|
|
//! Redis integration for Actix framework.
|
|
|
|
//!
|
|
|
|
//! ## Documentation
|
|
|
|
//! * [API Documentation (Development)](http://actix.github.io/actix-redis/actix_redis/)
|
|
|
|
//! * [API Documentation (Releases)](https://docs.rs/actix-redis/)
|
|
|
|
//! * [Chat on gitter](https://gitter.im/actix/actix)
|
|
|
|
//! * Cargo package: [actix-redis](https://crates.io/crates/actix-redis)
|
2018-07-20 14:53:56 -07:00
|
|
|
//! * Minimum supported Rust version: 1.26 or later
|
2018-05-08 10:12:57 -07:00
|
|
|
//!
|
2017-12-28 21:14:04 -08:00
|
|
|
#[macro_use]
|
2018-01-22 00:40:50 -08:00
|
|
|
extern crate log;
|
|
|
|
#[macro_use]
|
2017-12-28 21:14:04 -08:00
|
|
|
extern crate redis_async;
|
|
|
|
#[macro_use]
|
2019-03-29 11:31:48 -07:00
|
|
|
extern crate derive_more;
|
2017-12-29 01:20:29 -08:00
|
|
|
|
2017-12-28 21:14:04 -08:00
|
|
|
mod redis;
|
2018-01-22 22:28:29 -08:00
|
|
|
pub use redis::{Command, RedisActor};
|
2018-01-22 00:40:50 -08:00
|
|
|
|
2018-05-08 10:12:57 -07:00
|
|
|
#[cfg(feature = "web")]
|
2017-12-28 21:14:04 -08:00
|
|
|
mod session;
|
2018-05-08 10:12:57 -07:00
|
|
|
#[cfg(feature = "web")]
|
2019-03-30 08:21:47 -07:00
|
|
|
pub use actix_web::cookie::SameSite;
|
2018-07-19 11:23:11 -07:00
|
|
|
#[cfg(feature = "web")]
|
2019-03-29 11:31:48 -07:00
|
|
|
pub use session::RedisSession;
|
2018-01-22 10:42:13 -08:00
|
|
|
|
2018-02-17 21:37:30 +03:00
|
|
|
/// General purpose actix redis error
|
2019-03-29 11:31:48 -07:00
|
|
|
#[derive(Debug, Display, From)]
|
2018-01-22 10:42:13 -08:00
|
|
|
pub enum Error {
|
2019-03-29 11:31:48 -07:00
|
|
|
#[display(fmt = "Redis error {}", _0)]
|
2018-01-22 10:42:13 -08:00
|
|
|
Redis(redis_async::error::Error),
|
|
|
|
/// Receiving message during reconnecting
|
2019-03-29 11:31:48 -07:00
|
|
|
#[display(fmt = "Redis: Not connected")]
|
2018-01-22 10:42:13 -08:00
|
|
|
NotConnected,
|
|
|
|
/// Cancel all waters when connection get dropped
|
2019-03-29 11:31:48 -07:00
|
|
|
#[display(fmt = "Redis: Disconnected")]
|
2018-01-22 10:42:13 -08:00
|
|
|
Disconnected,
|
|
|
|
}
|
|
|
|
|
2019-12-16 10:57:34 +06:00
|
|
|
#[cfg(feature = "web")]
|
|
|
|
impl actix_web::ResponseError for Error {}
|
|
|
|
|
2018-01-22 22:28:29 -08:00
|
|
|
// re-export
|
|
|
|
pub use redis_async::error::Error as RespError;
|
2018-05-08 10:12:57 -07:00
|
|
|
pub use redis_async::resp::RespValue;
|