pub(crate) struct BufferProgress {
processed: usize,
discard: usize,
}
Expand description
Accounting structure tracking progress in parsing a single buffer.
Fields§
§processed: usize
Prefix of the buffer that has been processed so far.
processed
may exceed discard
, that means we have parsed
some buffer, but are still using it. This happens due to
in-place decryption of incoming records, and in-place
reassembly of handshake messages.
0 <= processed <= len
discard: usize
Prefix of the buffer that can be removed.
If discard
exceeds processed
, that means we are ignoring
data without processing it.
0 <= discard <= len
Implementations§
Source§impl BufferProgress
impl BufferProgress
pub(super) fn new(processed: usize) -> Self
pub(crate) fn add_discard(&mut self, discard: usize)
pub(crate) fn add_processed(&mut self, processed: usize)
pub(crate) fn take_discard(&mut self) -> usize
pub(crate) fn processed(&self) -> usize
Trait Implementations§
Source§impl Clone for BufferProgress
impl Clone for BufferProgress
Source§fn clone(&self) -> BufferProgress
fn clone(&self) -> BufferProgress
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for BufferProgress
impl RefUnwindSafe for BufferProgress
impl Send for BufferProgress
impl Sync for BufferProgress
impl Unpin for BufferProgress
impl UnwindSafe for BufferProgress
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