use std::time::Duration;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct ReadOptions {
pub allow_expired: bool,
}
impl Default for ReadOptions {
fn default() -> Self {
Self {
allow_expired: false,
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct WriteOptions {
pub ttl: Option<Duration>,
pub overwrite: bool,
}
impl Default for WriteOptions {
fn default() -> Self {
Self {
ttl: None,
overwrite: true,
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct DeleteOptions {
pub must_exist: bool,
}
impl Default for DeleteOptions {
fn default() -> Self {
Self { must_exist: false }
}
}
#[derive(Debug, Clone, PartialEq, Eq, Default)]
pub struct ScanOptions {
pub prefix: Option<String>,
pub limit: Option<usize>,
pub include_expired: bool,
}