extract_fragment

Function extract_fragment 

Source
pub fn extract_fragment(raw: &[u8]) -> Option<FragmentHeader>
Expand description

Lightweight fragment extraction from an LpPacket.

Scans the TLV fields for Sequence, FragIndex, FragCount, and Fragment without creating Bytes sub-slices, parsing Nack headers, or allocating. Returns Some only if the packet is a multi-fragment LpPacket (frag_count > 1).

This is the hot-path parser for the fragment sieve — unfragmented LpPackets, Nacks, and bare Interest/Data fall through to the full LpPacket::decode.