pub mod dashmap;
#[cfg(test)]
pub mod mock;
pub mod moka;
#[cfg(feature = "redis")]
pub mod redis;
#[macro_export]
macro_rules! impl_backend_builder {
($backend:ty, $builder:ty) => {
impl $backend {
pub fn new() -> Self {
Self::builder().build()
}
pub fn builder() -> $builder {
<$builder>::default()
}
}
};
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum MemoryBackendType {
Moka,
DashMap,
}
pub use dashmap::DashMapMemoryBackend;
pub use moka::MokaMemoryBackend;
#[cfg(feature = "redis")]
pub use redis::{RedisBackend, RedisBackendBuilder, RedisMode};
pub use dashmap::dashmap_memory;
pub use moka::default_memory_backend;
pub use moka::moka_memory;