pub struct TlvDecodeStage {
pub face_table: Arc<FaceTable>,
/* private fields */
}Expand description
Decodes the raw bytes in ctx into an Interest, Data, or Nack.
Handles both bare Interest/Data packets and NDNLPv2 LpPacket-wrapped
packets. LpPackets with a Nack header produce a DecodedPacket::Nack.
On success sets ctx.packet and ctx.name. On any parse failure returns
Action::Drop(MalformedPacket).
Enforces /localhost scope: packets with names starting with /localhost
arriving on non-local faces are dropped.
Fields§
§face_table: Arc<FaceTable>Implementations§
Source§impl TlvDecodeStage
impl TlvDecodeStage
Sourcepub fn try_collect_fragment(
&self,
face_id: FaceId,
raw: Bytes,
) -> Result<Option<Bytes>, Bytes>
pub fn try_collect_fragment( &self, face_id: FaceId, raw: Bytes, ) -> Result<Option<Bytes>, Bytes>
Fast-path fragment collection that bypasses PacketContext creation.
If the raw bytes are a fragmented LpPacket, parses just the header fields
and feeds the fragment to the per-face ReassemblyBuffer.
Returns:
Ok(Some(bytes))— reassembly completed,bytesis the full packetOk(None)— fragment buffered, waiting for moreErr(bytes)— not a fragment (bare packet, unfragmented LpPacket, or Nack); caller should process through the full pipeline. The original bytes are returned back.
pub fn process(&self, ctx: PacketContext) -> Action
Auto Trait Implementations§
impl Freeze for TlvDecodeStage
impl !RefUnwindSafe for TlvDecodeStage
impl Send for TlvDecodeStage
impl Sync for TlvDecodeStage
impl Unpin for TlvDecodeStage
impl !UnwindSafe for TlvDecodeStage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more