• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

getdozer / dozer / 4116183752

pending completion
4116183752

push

github

GitHub
refactor: Make `LmdbRoCache` and `LmdbRwCache` `Send` and `Sync` (#821)

790 of 790 new or added lines in 44 files covered. (100.0%)

23005 of 33842 relevant lines covered (67.98%)

56312.85 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

62.07
/dozer-cache/src/cache/lmdb/mod.rs
1
use std::path::PathBuf;
2

3
pub mod cache;
4
pub mod comparator;
5
pub mod indexer;
6
pub mod query;
7
pub mod utils;
8

9
#[cfg(test)]
10
mod tests;
11

12
#[derive(Clone, Debug, Default)]
9✔
13
pub struct CacheOptions {
14
    pub common: CacheCommonOptions,
15
    pub kind: CacheOptionsKind,
16
}
17

18
#[derive(Clone, Debug)]
×
19
pub enum CacheOptionsKind {
20
    // Write Options
21
    Write(CacheWriteOptions),
22

23
    // Read Options
24
    ReadOnly(CacheReadOptions),
25
}
26

27
impl Default for CacheOptionsKind {
28
    fn default() -> Self {
9✔
29
        Self::Write(CacheWriteOptions::default())
9✔
30
    }
9✔
31
}
32

33
#[derive(Clone, Debug)]
96✔
34
pub struct CacheCommonOptions {
35
    // Total number of readers allowed
36
    pub max_readers: u32,
37
    // Max no of dbs
38
    pub max_db_size: u32,
39

40
    /// The chunk size when calculating intersection of index queries.
41
    pub intersection_chunk_size: usize,
42

43
    /// Provide a path where db will be created. If nothing is provided, will default to a temp location.
44
    /// Db path will be `PathBuf.join(String)`.
45
    pub path: Option<(PathBuf, String)>,
46
}
47

48
impl Default for CacheCommonOptions {
×
49
    fn default() -> Self {
104✔
50
        Self {
104✔
51
            max_readers: 1000,
104✔
52
            max_db_size: 1000,
104✔
53
            intersection_chunk_size: 100,
104✔
54
            path: None,
104✔
55
        }
104✔
56
    }
104✔
57
}
58

59
impl CacheCommonOptions {
×
60
    pub fn set_path(&mut self, base_path: PathBuf, name: String) {
×
61
        self.path = Some((base_path, name));
×
62
    }
×
63
}
64

×
65
#[derive(Clone, Debug, Default)]
×
66
pub struct CacheReadOptions {}
67

×
68
#[derive(Clone, Debug)]
×
69
pub struct CacheWriteOptions {
70
    // Total size allocated for data in a memory mapped file.
71
    // This size is allocated at initialization.
72
    pub max_size: usize,
73
}
74

75
impl Default for CacheWriteOptions {
×
76
    fn default() -> Self {
103✔
77
        Self {
103✔
78
            max_size: 1024 * 1024 * 1024,
103✔
79
        }
103✔
80
    }
103✔
81
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc