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

databendlabs / openraft / 20536767782
88%

Build:
DEFAULT BRANCH: main
Ran 27 Dec 2025 08:42AM UTC
Jobs 1
Files 253
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

27 Dec 2025 07:57AM UTC coverage: 88.455% (-0.04%) from 88.496%
20536767782

push

github

drmingdrmer
feat: add `Extensions` type-map for user-defined data storage

Add a flexible `Extensions` type-map that allows external crates to store
arbitrary types associated with a Raft instance, keyed by `TypeId`.

This follows the `http::Extensions` pattern, enabling multiple plugins to
store data independently without compile-time coordination.

Changes:
- Add `Extensions` struct in `openraft/src/extensions.rs`
- Add `Raft::extensions()` method returning `&Extensions`
- Values must implement `Clone` - `get()` returns cloned value to avoid deadlocks
- Use `Arc` for shared mutable state (e.g., `Arc<AtomicU64>`)

Usage:
```rust
#[derive(Clone)]
struct MyData(Arc<MyInner>);

raft.extensions().insert(MyData::default());
let data = raft.extensions().get::<MyData>().unwrap();
```

64 of 68 new or added lines in 2 files covered. (94.12%)

12 existing lines in 5 files now uncovered.

15669 of 17714 relevant lines covered (88.46%)

160555.01 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
4
93.85
openraft/src/extensions.rs

Uncovered Existing Lines

Lines Coverage ∆ File
1
83.33
0.0% openraft/src/metrics/serde_instant.rs
2
79.17
-8.33% openraft/src/core/sm/handle.rs
3
91.64
-0.35% openraft/src/core/raft_core.rs
3
90.77
-4.62% openraft/src/raft/raft_inner.rs
3
82.8
-3.23% openraft/src/replication/snapshot_transmitter.rs
Jobs
ID Job ID Ran Files Coverage
1 20536767782.1 27 Dec 2025 08:42AM UTC 253
88.46
GitHub Action Run
Source Files on build 20536767782
  • Tree
  • List 253
  • Changed 7
  • Source Changed 3
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #20536767782
  • f7990589 on github
  • Prev Build on main (#20524818897)
  • Next Build on main (#20536877331)
  • Delete
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