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
40
41
42
use super::{BinaryReader, OperatorsReader};
#[derive(Debug, Copy, Clone)]
pub struct InitExpr<'a> {
offset: usize,
data: &'a [u8],
}
impl<'a> InitExpr<'a> {
pub fn new(data: &[u8], offset: usize) -> InitExpr {
InitExpr { offset, data }
}
pub fn get_binary_reader<'b>(&self) -> BinaryReader<'b>
where
'a: 'b,
{
BinaryReader::new_with_offset(self.data, self.offset)
}
pub fn get_operators_reader<'b>(&self) -> OperatorsReader<'b>
where
'a: 'b,
{
OperatorsReader::new(self.data, self.offset)
}
}