pub struct MessageDeframer { /* private fields */ }
Expand description
This deframer works to reconstruct TLS messages from a stream of arbitrary-sized reads.
It buffers incoming data into a Vec
through read()
, and returns messages through pop()
.
QUIC connections will call push()
to append handshake payload data directly.
Implementations
sourceimpl MessageDeframer
impl MessageDeframer
sourcepub fn pop(
&mut self,
record_layer: &mut RecordLayer
) -> Result<Option<Deframed>, Error>
pub fn pop(
&mut self,
record_layer: &mut RecordLayer
) -> Result<Option<Deframed>, Error>
Return any decrypted messages that the deframer has been able to parse.
Returns an Error
if the deframer failed to parse some message contents or if decryption
failed, Ok(None)
if no full message is buffered or if trial decryption failed, and
Ok(Some(_))
if a valid message was found and decrypted successfully.
sourcepub fn read(&mut self, rd: &mut dyn Read) -> Result<usize>
pub fn read(&mut self, rd: &mut dyn Read) -> Result<usize>
Read some bytes from rd
, and add them to our internal buffer.
sourcepub fn has_pending(&self) -> bool
pub fn has_pending(&self) -> bool
Returns true if we have messages for the caller to process, either whole messages in our output queue or partial messages in our buffer.