pub struct EchoSessionParser;Available on crate feature
session and (crate features test-helpers) only.Expand description
A SessionParser that echoes each fed chunk as a side-tagged
Vec<u8> message. Use when test code wants to inspect the
reassembled byte stream.
Trait Implementations§
Source§impl Clone for EchoSessionParser
impl Clone for EchoSessionParser
Source§impl Debug for EchoSessionParser
impl Debug for EchoSessionParser
Source§impl Default for EchoSessionParser
impl Default for EchoSessionParser
Source§impl SessionParser for EchoSessionParser
impl SessionParser for EchoSessionParser
Source§fn feed_initiator(
&mut self,
bytes: &[u8],
_ts: Timestamp,
out: &mut Vec<Self::Message>,
)
fn feed_initiator( &mut self, bytes: &[u8], _ts: Timestamp, out: &mut Vec<Self::Message>, )
Feed the next chunk of bytes from the initiator side.
ts is the observed time of the packet carrying these bytes.
Push any complete messages parsed during this call into
out. Read moreSource§fn feed_responder(
&mut self,
bytes: &[u8],
_ts: Timestamp,
out: &mut Vec<Self::Message>,
)
fn feed_responder( &mut self, bytes: &[u8], _ts: Timestamp, out: &mut Vec<Self::Message>, )
Feed the next chunk of bytes from the responder side.
Source§fn fin_initiator(&mut self, _out: &mut Vec<Self::Message>)
fn fin_initiator(&mut self, _out: &mut Vec<Self::Message>)
The initiator side ended cleanly: called once at flow end when
the flow ended gracefully (
EndReason::is_graceful: FIN,
idle timeout, force close) or the initiator sent a FIN — after
its final bytes were fed. Not called for a side the parser
stopped reading (GapResponse::StopSide, reassembly stop).
Default: no-op.Source§fn fin_responder(&mut self, _out: &mut Vec<Self::Message>)
fn fin_responder(&mut self, _out: &mut Vec<Self::Message>)
The responder side ended cleanly; see
fin_initiator.Source§fn rst_initiator(&mut self)
fn rst_initiator(&mut self)
The initiator side ended abruptly: called once at flow end
instead of
fin_initiator when the flow
was not ended gracefully (RST, eviction) and this side sent no
FIN. Not called for a stopped side. Default: no-op.Source§fn rst_responder(&mut self)
fn rst_responder(&mut self)
The responder side ended abruptly; see
rst_initiator.Source§fn on_tick(&mut self, _now: Timestamp, _out: &mut Vec<Self::Message>)
fn on_tick(&mut self, _now: Timestamp, _out: &mut Vec<Self::Message>)
Periodic time hook. The driver calls this on every
sweep /
finish with the sweep’s now, for every still-live parser.
Lets stateful parsers emit time-driven messages (timeouts,
unanswered requests). Emitted messages are attributed to
FlowSide::Initiator. Default: no-op.Source§fn on_gap(
&mut self,
_side: FlowSide,
_missing: u64,
_ts: Timestamp,
_out: &mut Vec<Self::Message>,
) -> GapResponse
fn on_gap( &mut self, _side: FlowSide, _missing: u64, _ts: Timestamp, _out: &mut Vec<Self::Message>, ) -> GapResponse
Bytes are missing from
side’s stream: missing bytes the
reassembler never saw (capture loss, asymmetric routing, an
out-of-order hole that expired, or bytes dropped by the
sliding-window buffer cap). The next feed_* call for that
side resumes after the hole. Read moreSource§fn is_poisoned(&self) -> bool
fn is_poisoned(&self) -> bool
True after the parser has hit an unrecoverable error and
can no longer make progress. The engines check this after
every
feed_* / on_gap / on_tick call and close the parser
on true — it is not fed again for that flow, and the flow
itself stays tracked. Default: false (parser never poisons). Read moreSource§fn poison_reason(&self) -> Option<&str>
fn poison_reason(&self) -> Option<&str>
Optional human-readable description of why the parser
poisoned. Consulted only when
is_poisoned
returns true. Default: None. Read moreSource§fn is_done(&self) -> bool
fn is_done(&self) -> bool
Symmetric “I’m done — close this flow cleanly” signal.
Default:
false (parser never self-terminates). Read moreSource§fn parser_kind(&self) -> ParserKind
fn parser_kind(&self) -> ParserKind
Typed identity of this parser, surfaced on
crate::driver::Event::ParserClosed::parser_kind and
crate::driver::SlotHandle::parser_kind. Lifted from
&'static str to the ParserKind enum in 0.20 (#109);
originally added in 0.5.0. Read moreAuto Trait Implementations§
impl Freeze for EchoSessionParser
impl RefUnwindSafe for EchoSessionParser
impl Send for EchoSessionParser
impl Sync for EchoSessionParser
impl Unpin for EchoSessionParser
impl UnsafeUnpin for EchoSessionParser
impl UnwindSafe for EchoSessionParser
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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