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