pub struct HandshakeJoiner {
pub frames: VecDeque<Message>,
buf: Vec<u8>,
}
Expand description
This works to reconstruct TLS handshake messages from individual TLS messages. It’s guaranteed that TLS messages output from this layer contain precisely one handshake payload.
Fields§
§frames: VecDeque<Message>
Completed handshake frames for output.
buf: Vec<u8>
The message payload we’re currently accumulating.
Implementations§
source§impl HandshakeJoiner
impl HandshakeJoiner
sourcepub fn want_message(&self, msg: &PlainMessage) -> bool
pub fn want_message(&self, msg: &PlainMessage) -> bool
Do we want to process this message?
sourcepub fn take_message(&mut self, msg: PlainMessage) -> Option<usize>
pub fn take_message(&mut self, msg: PlainMessage) -> Option<usize>
Take the message, and join/split it as needed. Return the number of new messages added to the output deque as a result of this message.
Returns None if msg or a preceding message was corrupt. You cannot recover from this situation. Otherwise returns a count of how many messages we queued.
sourcefn buf_contains_message(&self) -> BufferState
fn buf_contains_message(&self) -> BufferState
Does our buf
contain a full handshake payload? It does if it is big
enough to contain a header, and that header has a length which falls
within buf
.
sourcefn deframe_one(&mut self, version: ProtocolVersion) -> bool
fn deframe_one(&mut self, version: ProtocolVersion) -> bool
Take a TLS handshake payload off the front of buf
, and put it onto
the back of our frames
deque inside a normal Message
.
Returns false if the stream is desynchronised beyond repair.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HandshakeJoiner
impl RefUnwindSafe for HandshakeJoiner
impl Send for HandshakeJoiner
impl Sync for HandshakeJoiner
impl Unpin for HandshakeJoiner
impl UnwindSafe for HandshakeJoiner
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
§impl<Tail, T> Prepend<T> for Tail
impl<Tail, T> Prepend<T> for Tail
§type PreprendResult = Tail
type PreprendResult = Tail
TupleList
], of an [Prepend::prepend()
] call,
including the prepended entry.