syntax_rs/snapshot.rs
1pub struct Snapshot(pub usize);
2
3impl From<usize> for Snapshot {
4 fn from(index: usize) -> Self {
5 Snapshot(index)
6 }
7}
8
9impl From<Snapshot> for usize {
10 fn from(snap: Snapshot) -> Self {
11 snap.0
12 }
13}
14
15impl Snapshot {
16 #[inline]
17 pub fn index(&self) -> usize {
18 self.0
19 }
20}