Skip to main content

rajac_types/
type_id.rs

1use std::fmt;
2
3#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
4pub struct TypeId(pub u32);
5
6impl TypeId {
7    pub const INVALID: TypeId = TypeId(u32::MAX);
8}
9
10impl fmt::Display for TypeId {
11    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
12        write!(f, "TypeId({})", self.0)
13    }
14}