static ids

This commit is contained in:
2025-08-25 16:12:49 -04:00
parent 41103f2732
commit 7b21b0714d
4 changed files with 172 additions and 33 deletions

View File

@@ -37,4 +37,20 @@ impl Id {
pub fn duplicate(&self) -> Self {
Self(self.0)
}
/// this must be used carefully to make sure
/// all IDs are still valid references.
/// generally should not be used in "user" code
pub fn copyable(&self) -> CopyId {
CopyId(self.0)
}
}
#[derive(Eq, Hash, PartialEq, Debug, Clone, Copy)]
pub struct CopyId(u64);
impl CopyId {
pub fn id(&self) -> Id {
Id(self.0)
}
}