pub struct MessageDeframer {
pub frames: VecDeque<OpaqueMessage>,
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<OpaqueMessage>
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() -> Self
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
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more