stable_id/sequence.rs
1use stable_id_traits::Successor;
2
3use crate::Sequence;
4
5impl<IndexT> Sequence<IndexT>
6where
7 IndexT: Successor + Clone + Copy,
8{
9 pub const fn continue_from(start: IndexT) -> Self {
10 Self { counter: start }
11 }
12
13 pub fn next_value(&mut self) -> IndexT {
14 let ret = self.counter;
15 self.counter = ret.next_value();
16 ret
17 }
18}