static ids
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user