orbit_rs/ring/cursor/
state.rs1#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
6pub struct RingCursor {
7 next_counter: u64,
8}
9
10impl RingCursor {
11 pub const fn from_start() -> Self {
14 Self { next_counter: 0 }
15 }
16
17 pub const fn from_counter(next_counter: u64) -> Self {
19 Self { next_counter }
20 }
21
22 pub const fn next_counter(self) -> u64 {
24 self.next_counter
25 }
26
27 pub(crate) fn set_next_counter(&mut self, next_counter: u64) {
28 self.next_counter = next_counter;
29 }
30}