Skip to main content

Reassembler

Struct Reassembler 

Source
pub struct Reassembler {
    pub max_message_size: usize,
    /* private fields */
}
Expand description

Receive-Algorithm Reassembler.

Fields§

§max_message_size: usize

Spec §10.1: Caller setzt diesen Wert um DoS zu vermeiden. usize::MAX deaktiviert das Limit.

Implementations§

Source§

impl Reassembler

Source

pub fn new() -> Self

Konstruktor mit usize::MAX-Limit (kein DoS-Schutz — Caller MUSS max_message_size setzen wenn extern erreichbar).

Source

pub fn with_limit(max_message_size: usize) -> Self

Konstruktor mit explizitem DoS-Cap.

Source

pub fn feed(&mut self, frame: &Frame) -> Result<Option<Message>, ReceiveError>

Spec §6.2 — verarbeite ein Frame und liefere ggf. eine fertige Message (FIN=1 + valide UTF-8 fuer Text).

Control-Frames (Close/Ping/Pong) werden NICHT reassembled (Spec §5.5: control frames MUST NOT be fragmented). Caller behandelt diese separat; wir geben sie einfach als Ok(Some(_)) zurueck mit is_text=false.

§Errors

Siehe ReceiveError.

Source

pub fn has_pending(&self) -> bool

true wenn eine Continuation-Sequenz aktiv ist (ein noch nicht abgeschlossenes Reassembly).

Trait Implementations§

Source§

impl Debug for Reassembler

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Reassembler

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.