1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-02-13 15:12:20 +01:00
actix-extras/src/lib.rs

68 lines
1.7 KiB
Rust
Raw Normal View History

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)
//! * Minimum supported Rust version: 1.21 or later
2018-05-08 10:12:57 -07:00
//!
2017-12-28 21:14:04 -08:00
extern crate actix;
2018-01-22 00:40:50 -08:00
extern crate backoff;
2017-12-28 21:14:04 -08:00
extern crate futures;
extern crate tokio_core;
2018-05-08 10:12:57 -07:00
extern crate tokio_io;
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]
extern crate failure;
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")]
2018-01-22 00:40:50 -08:00
extern crate actix_web;
2018-05-08 10:12:57 -07:00
#[cfg(feature = "web")]
2018-01-22 00:40:50 -08:00
extern crate cookie;
2018-05-08 10:12:57 -07:00
#[cfg(feature = "web")]
2018-01-22 00:40:50 -08:00
extern crate http;
2018-05-08 10:12:57 -07:00
#[cfg(feature = "web")]
extern crate rand;
#[cfg(feature = "web")]
2018-01-22 00:40:50 -08:00
extern crate serde;
2018-05-08 10:12:57 -07:00
#[cfg(feature = "web")]
2018-01-22 00:40:50 -08:00
extern crate serde_json;
2017-12-29 01:20:29 -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")]
2017-12-28 21:14:04 -08:00
pub use session::RedisSessionBackend;
2018-01-22 10:42:13 -08:00
2018-02-17 21:37:30 +03:00
/// General purpose actix redis error
2018-01-22 10:42:13 -08:00
#[derive(Fail, Debug)]
pub enum Error {
2018-05-08 10:12:57 -07:00
#[fail(display = "Redis error {}", _0)]
2018-01-22 10:42:13 -08:00
Redis(redis_async::error::Error),
/// Receiving message during reconnecting
2018-05-08 10:12:57 -07:00
#[fail(display = "Redis: Not connected")]
2018-01-22 10:42:13 -08:00
NotConnected,
/// Cancel all waters when connection get dropped
2018-05-08 10:12:57 -07:00
#[fail(display = "Redis: Disconnected")]
2018-01-22 10:42:13 -08:00
Disconnected,
}
unsafe impl Send for Error {}
unsafe impl Sync for Error {}
impl From<redis_async::error::Error> for Error {
fn from(err: redis_async::error::Error) -> Error {
Error::Redis(err)
}
}
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;