1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use crate::BigMapKey;
use naia_serde::{BitReader, BitWrite, Serde, SerdeErr};

// GlobalEntity
#[derive(PartialEq, Eq, Hash, Clone, Copy, Debug)]
pub struct GlobalEntity(u64);

impl BigMapKey for GlobalEntity {
    fn to_u64(&self) -> u64 {
        self.0
    }

    fn from_u64(value: u64) -> Self {
        GlobalEntity(value)
    }
}

impl Serde for GlobalEntity {
    fn ser(&self, _: &mut dyn BitWrite) {
        panic!("shouldn't call this");
    }

    fn de(_: &mut BitReader) -> Result<Self, SerdeErr> {
        panic!("shouldn't call this");
    }

    fn bit_length(&self) -> u32 {
        panic!("shouldn't call this");
    }
}