pub struct Http2Frame {
pub length: u32,
pub frame_type: u8,
pub flags: u8,
pub stream_id: u32,
pub payload: Vec<u8>,
}Expand description
An individual HTTP/2 protocol frame.
Fields§
§length: u32§frame_type: u8§flags: u8§stream_id: u32§payload: Vec<u8>Implementations§
Source§impl Http2Frame
impl Http2Frame
Sourcepub fn new(frame_type: u8, flags: u8, stream_id: u32, payload: Vec<u8>) -> Self
pub fn new(frame_type: u8, flags: u8, stream_id: u32, payload: Vec<u8>) -> Self
Constructs a new Http2Frame.
Sourcepub fn validate_invariants(&self) -> Result<(), FetchError>
pub fn validate_invariants(&self) -> Result<(), FetchError>
Validates frame invariants according to RFC 7540 Section 6.
Sourcepub fn read_from_bounded<R: Read>(
reader: &mut R,
max_frame_size: u32,
) -> Result<Self, FetchError>
pub fn read_from_bounded<R: Read>( reader: &mut R, max_frame_size: u32, ) -> Result<Self, FetchError>
Reads an individual frame from a synchronous byte stream, enforcing the active max frame size.
Trait Implementations§
Source§impl Clone for Http2Frame
impl Clone for Http2Frame
Source§impl Debug for Http2Frame
impl Debug for Http2Frame
impl Eq for Http2Frame
Source§impl PartialEq for Http2Frame
impl PartialEq for Http2Frame
impl StructuralPartialEq for Http2Frame
Auto Trait Implementations§
impl Forget for Http2Frame
impl Freeze for Http2Frame
impl Move for Http2Frame
impl RefUnwindSafe for Http2Frame
impl Send for Http2Frame
impl Sync for Http2Frame
impl Unpin for Http2Frame
impl UnsafeUnpin for Http2Frame
impl UnwindSafe for Http2Frame
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