mod base;
mod stream;
mod distributed;
mod bucket;
mod map;
mod list;
mod set;
mod sort_set;
mod bloom_filter;
mod delayed_queue;
mod script;
mod batch;
mod atomic_long;
mod semaphore;
mod rate_limiter;
mod count_down_latch;
mod bit_set;
mod geo;
mod topic;
mod blocking_queue;
mod keys;
use std::time::Duration;
use serde::de::DeserializeOwned;
use serde::Serialize;
pub use base::*;
pub use distributed::*;
pub use keys::*;
pub use stream::*;
pub use bucket::*;
pub use map::*;
pub use list::*;
pub use set::*;
pub use sort_set::*;
pub use bloom_filter::*;
pub use delayed_queue::*;
pub use script::*;
pub use batch::*;
pub use atomic_long::*;
pub use semaphore::*;
pub use rate_limiter::*;
pub use count_down_latch::*;
pub use bit_set::*;
pub use geo::*;
pub use topic::*;
pub use blocking_queue::*;
use crate::{RedisConnection, RedissonResult};
pub trait RObject {
fn get_name(&self) -> &str;
fn delete(&self) -> RedissonResult<bool>;
fn rename(&self, new_name: &str) -> RedissonResult<()>;
fn is_exists(&self) -> RedissonResult<bool>;
fn move_to_db(&self, db_index: i32) -> RedissonResult<bool>;
fn get_expire_time(&self) -> RedissonResult<Option<Duration>>;
fn expire(&self, duration: Duration) -> RedissonResult<bool>;
fn expire_at(&self, timestamp: i64) -> RedissonResult<bool>;
fn clear_expire(&self) -> RedissonResult<bool>;
}
pub trait RObjectBase<V>: RObject
where
V: Serialize + DeserializeOwned + Send + Sync,
{
fn get_connection(&self) -> RedissonResult<RedisConnection>;
fn serialize_value(&self, value: &V) -> RedissonResult<String>;
fn deserialize_value(&self, data: &str) -> RedissonResult<V>;
fn get_full_key(&self) -> String {
self.get_name().to_string()
}
}