pub struct StunParser;Available on crate feature
stun only.Expand description
DatagramParser that emits one StunMessage per
well-formed STUN datagram. Aggressive about rejection
(top-two-bits-zero + magic cookie + length consistency
all required) so it’s safe to attempt on any UDP flow.
Implementations§
Source§impl StunParser
impl StunParser
Trait Implementations§
Source§impl Clone for StunParser
impl Clone for StunParser
Source§fn clone(&self) -> StunParser
fn clone(&self) -> StunParser
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for StunParser
Source§impl DatagramParser for StunParser
impl DatagramParser for StunParser
Source§type Message = StunMessage
type Message = StunMessage
Available on crate feature
session only.L7 message produced by this parser. Same
Debug bound as
SessionParser::Message.Source§fn parser_kind(&self) -> ParserKind
fn parser_kind(&self) -> ParserKind
Available on crate feature
session only.See
SessionParser::parser_kind. Default
ParserKind::Unspecified.Source§fn parse(
&mut self,
payload: &[u8],
_side: FlowSide,
_ts: Timestamp,
out: &mut Vec<Self::Message>,
)
fn parse( &mut self, payload: &[u8], _side: FlowSide, _ts: Timestamp, out: &mut Vec<Self::Message>, )
Available on crate feature
session only.Parse one L4 payload.
side is the direction relative to
the flow’s initiator; ts is the observed time of the
datagram. Push any complete messages decoded into out. Read moreSource§fn on_tick(&mut self, _now: Timestamp, _out: &mut Vec<Self::Message>)
fn on_tick(&mut self, _now: Timestamp, _out: &mut Vec<Self::Message>)
Available on crate feature
session only.Periodic time hook — see
SessionParser::on_tick. The
driver calls this on every sweep / finish. Default: no-op.Source§fn is_poisoned(&self) -> bool
fn is_poisoned(&self) -> bool
Available on crate feature
session only.True after the parser has hit an unrecoverable error. See
SessionParser::is_poisoned for the contract.Source§fn poison_reason(&self) -> Option<&str>
fn poison_reason(&self) -> Option<&str>
Available on crate feature
session only.Optional reason for poison. See
SessionParser::poison_reason.Source§fn is_done(&self) -> bool
fn is_done(&self) -> bool
Available on crate feature
session only.Symmetric “I’m done — close this flow cleanly” signal,
mirroring
SessionParser::is_done. Default: false.Source§impl Debug for StunParser
impl Debug for StunParser
Source§impl Default for StunParser
impl Default for StunParser
Source§fn default() -> StunParser
fn default() -> StunParser
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StunParser
impl RefUnwindSafe for StunParser
impl Send for StunParser
impl Sync for StunParser
impl Unpin for StunParser
impl UnsafeUnpin for StunParser
impl UnwindSafe for StunParser
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