Skip to main content

rajac_types/
method_id.rs

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