pub struct Data { /* private fields */ }
Expand description
Data frame
Data frames convey arbitrary, variable-length sequences of octets associated with a stream. One or more DATA frames are used, for instance, to carry HTTP request or response payloads.
Implementations§
Source§impl Data
impl Data
Sourcepub fn stream_id(&self) -> StreamId
pub fn stream_id(&self) -> StreamId
Returns the stream identifier that this frame is associated with.
This cannot be a zero stream identifier.
Sourcepub fn is_end_stream(&self) -> bool
pub fn is_end_stream(&self) -> bool
Gets the value of the END_STREAM
flag for this frame.
If true, this frame is the last that the endpoint will send for the identified stream.
Setting this flag causes the stream to enter one of the “half-closed” states or the “closed” state (Section 5.1).
Sourcepub fn set_end_stream(&mut self)
pub fn set_end_stream(&mut self)
Sets the value for the END_STREAM
flag on this frame.
Sourcepub fn set_padded(&mut self)
pub fn set_padded(&mut self)
Sets the value for the PADDED
flag on this frame.
Sourcepub fn payload(&self) -> &Bytes
pub fn payload(&self) -> &Bytes
Returns a reference to this frame’s payload.
This does not include any padding that might have been originally included.
Sourcepub fn payload_mut(&mut self) -> &mut Bytes
pub fn payload_mut(&mut self) -> &mut Bytes
Returns a mutable reference to this frame’s payload.
This does not include any padding that might have been originally included.
Sourcepub fn into_payload(self) -> Bytes
pub fn into_payload(self) -> Bytes
Consumes self
and returns the frame’s payload.
This does not include any padding that might have been originally included.