#[non_exhaustive]pub enum OverflowPolicy {
SlidingWindow,
DropFlow,
}tracker only.Expand description
What to do when crate::BufferedReassembler’s in-flight buffer
would exceed its configured cap.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
SlidingWindow
Drop the oldest undelivered bytes until the new payload fits.
The dropped bytes are reported as a gap in the reassembled
stream (so a session parser gets
crate::SessionParser::on_gap); bytes_dropped_oversize
counts them.
Default. Best for stream-shaped / append-only protocols (HTTP
body streams, plain TCP) where resync after a gap is well-defined.
The gap goes to the parser like any other: one that answers
crate::session::GapResponse::Continue keeps parsing; with the
default crate::session::GapResponse::StopSide that side
stops being parsed.
DropFlow
Stop reassembling this side: the buffered in-order bytes are
still delivered, then the stream ends with
crate::ReassemblyStop::Overflow. The flow keeps being
tracked (so its later packets are not mistaken for a new
connection); a session parser reading the side stops reading
it (a side stop with EndReason::BufferOverflow) while the
other side goes on.
Best for framed binary protocols (DES PSMSG, TLS records, length-prefixed wire formats) where a mid-frame gap would permanently desync the parser.
Trait Implementations§
Source§impl Clone for OverflowPolicy
impl Clone for OverflowPolicy
impl Copy for OverflowPolicy
Source§impl Debug for OverflowPolicy
impl Debug for OverflowPolicy
Source§impl Default for OverflowPolicy
impl Default for OverflowPolicy
Source§impl<'de> Deserialize<'de> for OverflowPolicy
Available on crate feature serde only.
impl<'de> Deserialize<'de> for OverflowPolicy
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for OverflowPolicy
Source§impl PartialEq for OverflowPolicy
impl PartialEq for OverflowPolicy
Source§impl Serialize for OverflowPolicy
Available on crate feature serde only.
impl Serialize for OverflowPolicy
serde only.impl StructuralPartialEq for OverflowPolicy
Auto Trait Implementations§
impl Freeze for OverflowPolicy
impl RefUnwindSafe for OverflowPolicy
impl Send for OverflowPolicy
impl Sync for OverflowPolicy
impl Unpin for OverflowPolicy
impl UnsafeUnpin for OverflowPolicy
impl UnwindSafe for OverflowPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.