pub struct CryptoFrame { /* private fields */ }
Expand description
CRYPTO Frame
CRYPTO Frame {
Type (i) = 0x06,
Offset (i),
Length (i),
Crypto Data (..),
}
See crypto frames of QUIC for more details.
Implementations§
Source§impl CryptoFrame
impl CryptoFrame
Sourcepub fn new(offset: VarInt, length: VarInt) -> Self
pub fn new(offset: VarInt, length: VarInt) -> Self
Create a new CryptoFrame
with the given offset and length.
Sourcepub fn estimate_max_capacity(capacity: usize, offset: u64) -> Option<usize>
pub fn estimate_max_capacity(capacity: usize, offset: u64) -> Option<usize>
Evaluate the maximum number of bytes of data that can be accommodated, starting from a certain offset, within a given capacity. If it cannot accommodate a CryptoFrame header or can only accommodate 0 bytes, return None.
Note: Panic if the offset exceeds 2^62-1, or the the capacity is too large (about 2^32. It is impossible to have so much crypto stream data)
Trait Implementations§
Source§impl Clone for CryptoFrame
impl Clone for CryptoFrame
Source§fn clone(&self) -> CryptoFrame
fn clone(&self) -> CryptoFrame
Returns a duplicate 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 moreSource§impl Debug for CryptoFrame
impl Debug for CryptoFrame
Source§impl EncodeSize for CryptoFrame
impl EncodeSize for CryptoFrame
Source§fn max_encoding_size(&self) -> usize
fn max_encoding_size(&self) -> usize
Return the max number of bytes needed to encode this value Read more
Source§fn encoding_size(&self) -> usize
fn encoding_size(&self) -> usize
Return the exact number of bytes needed to encode this value
Source§impl GetFrameType for CryptoFrame
impl GetFrameType for CryptoFrame
Source§fn frame_type(&self) -> FrameType
fn frame_type(&self) -> FrameType
Return the type of frame
Source§impl PartialEq for CryptoFrame
impl PartialEq for CryptoFrame
impl Copy for CryptoFrame
impl Eq for CryptoFrame
impl StructuralPartialEq for CryptoFrame
Auto Trait Implementations§
impl Freeze for CryptoFrame
impl RefUnwindSafe for CryptoFrame
impl Send for CryptoFrame
impl Sync for CryptoFrame
impl Unpin for CryptoFrame
impl UnwindSafe for CryptoFrame
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FrameFeture for Twhere
T: GetFrameType,
impl<T> FrameFeture for Twhere
T: GetFrameType,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Source§impl<T, D> WriteDataFrame<CryptoFrame, D> for T
impl<T, D> WriteDataFrame<CryptoFrame, D> for T
Source§fn put_data_frame(&mut self, frame: &CryptoFrame, data: &D)
fn put_data_frame(&mut self, frame: &CryptoFrame, data: &D)
Write a frame and its data to the buffer.