pub struct MessageDeframer {
pub frames: VecDeque<Message>,
pub desynced: bool,
/* private fields */
}
Expand description
This deframer works to reconstruct TLS messages
from arbitrary-sized reads, buffering as necessary.
The input is read()
, the output is the frames
deque.
Fields
frames: VecDeque<Message>
Completed frames for output.
desynced: bool
Set to true if the peer is not talking TLS, but some other protocol. The caller should abort the connection, because the deframer cannot recover.
Implementations
sourceimpl MessageDeframer
impl MessageDeframer
pub fn new() -> MessageDeframer
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. If this means our internal buffer contains
full messages, decode them all.
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
sourceimpl Default for MessageDeframer
impl Default for MessageDeframer
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
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more