Skip to main content

luaur_code_gen/records/
constant_key.rs

1use crate::enums::ir_const_kind::IrConstKind;
2
3#[derive(Debug, Clone, Copy, Hash)]
4#[repr(C)]
5pub struct ConstantKey {
6    pub(crate) kind: IrConstKind,
7    pub(crate) value: u64,
8}
9
10impl PartialEq for ConstantKey {
11    fn eq(&self, other: &Self) -> bool {
12        self.kind == other.kind && self.value == other.value
13    }
14}
15
16impl Eq for ConstantKey {}
17
18impl Default for ConstantKey {
19    fn default() -> Self {
20        Self {
21            kind: IrConstKind::Int,
22            value: 0,
23        }
24    }
25}