1use std::time::Duration;
4
5#[derive(Debug, Clone, Copy, PartialEq, Eq)]
7pub struct ReadOptions {
8 pub allow_expired: bool,
10}
11
12impl Default for ReadOptions {
13 fn default() -> Self {
14 Self {
15 allow_expired: false,
16 }
17 }
18}
19
20#[derive(Debug, Clone, Copy, PartialEq, Eq)]
22pub struct WriteOptions {
23 pub ttl: Option<Duration>,
25 pub overwrite: bool,
27}
28
29impl Default for WriteOptions {
30 fn default() -> Self {
31 Self {
32 ttl: None,
33 overwrite: true,
34 }
35 }
36}
37
38#[derive(Debug, Clone, Copy, PartialEq, Eq)]
40pub struct DeleteOptions {
41 pub must_exist: bool,
43}
44
45impl Default for DeleteOptions {
46 fn default() -> Self {
47 Self { must_exist: false }
48 }
49}
50
51#[derive(Debug, Clone, PartialEq, Eq, Default)]
53pub struct ScanOptions {
54 pub prefix: Option<String>,
56 pub limit: Option<usize>,
58 pub include_expired: bool,
60}