rajac_types/field_id.rs
1use std::fmt;
2
3/// Identifier for a field signature stored in a `FieldArena`.
4#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
5pub struct FieldId(pub u32);
6
7impl FieldId {
8 /// Sentinel for an invalid or missing field id.
9 pub const INVALID: FieldId = FieldId(u32::MAX);
10}
11
12impl fmt::Display for FieldId {
13 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
14 write!(f, "FieldId({})", self.0)
15 }
16}