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
31
32
33
34
35
36
37
38
39
use crate::*;
pub(crate) unsafe trait Pod {}
pub(crate) unsafe trait CopyPod: Copy {}
unsafe impl CopyPod for u8 {}
unsafe impl CopyPod for u16 {}
unsafe impl CopyPod for u32 {}
unsafe impl CopyPod for u64 {}
unsafe impl CopyPod for i8 {}
unsafe impl CopyPod for i16 {}
unsafe impl CopyPod for i32 {}
unsafe impl CopyPod for i64 {}
pub(crate) trait View {
fn view_as<T: Pod>(&self, cli_offset: u32) -> &T;
fn view_as_slice_of<T: Pod>(&self, cli_offset: u32, len: u32) -> &[T];
fn copy_as<T: Copy + CopyPod>(&self, cli_offset: u32) -> T;
fn view_as_str(&self, cli_offset: u32) -> &[u8];
}
pub trait Decode {
fn decode(reader: &'static TypeReader, code: u32, file: u16) -> Self;
}