pub struct MessageDeframer { /* private fields */ }
Expand description
This deframer works to reconstruct TLS messages
from arbitrary-sized reads, buffering as necessary.
The input is read()
, get the output from pop()
.
Implementations§
source§impl MessageDeframer
impl MessageDeframer
pub fn new() -> Self
sourcepub fn pop(&mut self) -> Result<Option<OpaqueMessage>, Error>
pub fn pop(&mut self) -> Result<Option<OpaqueMessage>, Error>
Return any complete messages that the deframer has been able to parse.
Returns an Error
if the deframer failed to parse some message contents,
Ok(None)
if no full message is buffered, and Ok(Some(_))
if a valid message was found.
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.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for MessageDeframer
impl Send for MessageDeframer
impl Sync for MessageDeframer
impl Unpin for MessageDeframer
impl UnwindSafe for MessageDeframer
Blanket Implementations§
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