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
43
44
45
46
47
48
49
50
51
use PhantomData;
use crate::*;
/// A lightweight representation of a parsed packet with block references and optional raw payload.
///
/// This structure is used when:
/// - You want to keep references to already-decoded blocks (`BR`)
/// - You don’t need to immediately decode the payload (it can remain as a raw slice)
///
/// Useful in zero-copy parsing scenarios or when working with external buffers.
///
/// # Type Parameters
/// - `B`: The original block type, implementing [`BlockDef`].
/// - `BR`: The referred/parsed block type, implementing [`BlockReferredDef<B>`].
///
/// # Fields
/// - `blocks`: A vector of referred block objects.
/// - `header`: The parsed packet header.
/// - `payload`: Optional raw payload slice (usually borrowed from a buffer).
/// - `_b`: Phantom marker to retain the `B` type.