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

databendlabs / openraft / 22860163403
88%

Build:
DEFAULT BRANCH: main
Ran 09 Mar 2026 03:14PM UTC
Jobs 1
Files 258
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

09 Mar 2026 03:11PM UTC coverage: 87.506% (-0.1%) from 87.604%
22860163403

push

github

drmingdrmer
change: in 0.10.0: convert `RaftVote` from `RaftVote<C>` to associated type with `type LeaderId`

Decouple `RaftVote` from `RaftTypeConfig` by replacing the `C: RaftTypeConfig`
type parameter with an associated type `LeaderId: RaftLeaderId`. This mirrors
the earlier `RaftLeaderId` refactoring and breaks the circular type dependency
where `RaftTypeConfig` referenced `RaftVote<Self>`.

Internal vote types (`CommittedVote`, `UncommittedVote`, `VoteStatus`, `RefVote`)
are now parameterized by `LID: RaftLeaderId` instead of `C: RaftTypeConfig`,
and `into_vote()` becomes generic over `V: RaftVote<LeaderId = LID>` so callers
choose the concrete vote type without knowing `C`.

Type aliases `CommittedVoteOf<C>`, `UncommittedVoteOf<C>`, `LeaderTerm<LID>`,
`LeaderNodeId<LID>`, and `LeaderCommitted<LID>` are added to keep call sites
concise.

Changes:
- `RaftVote<C>` becomes `RaftVote { type LeaderId: RaftLeaderId }`;
  bound changes from `Vote: RaftVote<Self>` to `Vote: RaftVote<LeaderId = Self::LeaderId>`
- `CommittedVote<C>` / `UncommittedVote<C>` / `VoteStatus<C>` / `RefVote<C>`
  become `<LID>` where `LID: RaftLeaderId`
- `into_vote()` on `CommittedVote` and `UncommittedVote` is now generic:
  `fn into_vote<V: RaftVote<LeaderId = LID>>(self) -> V`

Upgrade tip:

Replace `impl RaftVote<C> for MyVote` with:
    impl RaftVote for MyVote {
        type LeaderId = MyLeaderId;
        // ...
    }

Replace trait bounds `V: RaftVote<C>` with `V: RaftVote<LeaderId = C::LeaderId>`.

129 of 146 new or added lines in 21 files covered. (88.36%)

16 existing lines in 5 files now uncovered.

15856 of 18120 relevant lines covered (87.51%)

146038.44 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
85.71
0.0% openraft/src/raft_state/io_state/log_io_id.rs
1
81.48
0.71% openraft/src/vote/non_committed.rs
1
83.33
0.0% openraft/src/vote/ref_vote.rs
5
72.97
-3.5% openraft/src/vote/committed.rs
9
92.25
-6.77% openraft/src/vote/raft_vote.rs

Uncovered Existing Lines

Lines Coverage ∆ File
1
83.33
0.0% openraft/src/metrics/serde_instant.rs
2
81.48
-7.41% openraft/src/core/sm/handle.rs
2
72.97
-3.5% openraft/src/vote/committed.rs
3
82.8
-3.23% openraft/src/replication/snapshot_transmitter.rs
8
86.96
-8.7% openraft/src/core/heartbeat/worker.rs
Jobs
ID Job ID Ran Files Coverage
1 22860163403.1 09 Mar 2026 03:14PM UTC 258
87.51
GitHub Action Run
Source Files on build 22860163403
  • Tree
  • List 258
  • Changed 34
  • Source Changed 32
  • Coverage Changed 15
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #22860163403
  • cd9ee654 on github
  • Prev Build on main (#22843283239)
  • Next Build on main (#22864138805)
  • 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