pub struct DataFrame {
pub data: Vec<u8>,
/* private fields */
}Expand description
A struct representing the DATA frames of HTTP/2, as defined in the HTTP/2 spec, section 6.1.
Fields§
§data: Vec<u8>The data found in the frame as an opaque byte sequence. It never includes padding bytes.
Implementations§
Source§impl DataFrame
impl DataFrame
Sourcepub fn new(stream_id: StreamId) -> DataFrame
pub fn new(stream_id: StreamId) -> DataFrame
Creates a new empty DataFrame, associated to the stream with the
given ID.
Sourcepub fn is_end_of_stream(&self) -> bool
pub fn is_end_of_stream(&self) -> bool
Returns whther this frame ends the stream it is associated with.
Sourcepub fn set_padding(&mut self, pad_len: u8)
pub fn set_padding(&mut self, pad_len: u8)
Sets the number of bytes that should be used as padding for this frame.
Trait Implementations§
Source§impl Frame for DataFrame
impl Frame for DataFrame
Source§fn from_raw(raw_frame: RawFrame) -> Option<DataFrame>
fn from_raw(raw_frame: RawFrame) -> Option<DataFrame>
Creates a new DataFrame from the given RawFrame (i.e. header and
payload), if possible. Returns None if a valid DataFrame cannot be
constructed from the given RawFrame.
Source§fn get_stream_id(&self) -> StreamId
fn get_stream_id(&self) -> StreamId
Returns the StreamId of the stream to which the frame is associated.
Source§fn get_header(&self) -> FrameHeader
fn get_header(&self) -> FrameHeader
Returns a FrameHeader based on the current state of the frame.
impl StructuralPartialEq for DataFrame
Auto Trait Implementations§
impl Freeze for DataFrame
impl RefUnwindSafe for DataFrame
impl Send for DataFrame
impl Sync for DataFrame
impl Unpin for DataFrame
impl UnwindSafe for DataFrame
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