24 lines
407 B
Rust
24 lines
407 B
Rust
use crate::pos::PosCounter;
|
|
|
|
pub struct IndexPosCounter {
|
|
index: usize,
|
|
}
|
|
|
|
impl Default for IndexPosCounter {
|
|
fn default() -> Self {
|
|
return IndexPosCounter { index: 0 };
|
|
}
|
|
}
|
|
|
|
impl<C: Copy> PosCounter<'static, C> for IndexPosCounter {
|
|
type P = usize;
|
|
|
|
fn update(&mut self, _: C) {
|
|
self.index += 1;
|
|
}
|
|
|
|
fn export(&self) -> usize {
|
|
return self.index;
|
|
}
|
|
}
|