summaryrefslogtreecommitdiffstats
path: root/third_party/rust/jsparagus-stencil/src/frame_slot.rs
blob: 84ae4e4c02f87de7477adceab3b155fececeb2d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/// Slot in the stack frame.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Ord, PartialOrd)]
pub struct FrameSlot {
    slot: u32,
}

impl FrameSlot {
    pub fn new(slot: u32) -> Self {
        Self { slot }
    }

    pub fn next(&mut self) {
        self.slot += 1;
    }
}

impl From<FrameSlot> for u32 {
    fn from(slot: FrameSlot) -> u32 {
        slot.slot
    }
}