blocky_nbt/tag/
kind.rs

1#[derive(Debug, PartialEq)]
2pub enum Kind {
3    End,
4    Byte,
5    Short,
6    Int,
7    Long,
8    Float,
9    Double,
10    ByteArray,
11    String,
12    List(u8),
13    Compound,
14    IntArray,
15    LongArray,
16}
17
18impl Kind {
19    pub fn id(&self) -> u8 {
20        match self {
21            Self::End => 0,
22            Self::Byte => 1,
23            Self::Short => 2,
24            Self::Int => 3,
25            Self::Long => 4,
26            Self::Float => 5,
27            Self::Double => 6,
28            Self::ByteArray => 7,
29            Self::String => 8,
30            Self::List(_) => 9,
31            Self::Compound => 10,
32            Self::IntArray => 11,
33            Self::LongArray => 12,
34        }
35    }
36}
37
38impl Into<u8> for Kind {
39    fn into(self) -> u8 {
40        self.id()
41    }
42}