pub struct Headers {
stream_id: StreamId,
stream_dep: Option<StreamDependency>,
header_block: HeaderBlock,
flags: HeadersFlag,
}
Expand description
Header frame
This could be either a request or a response.
Fields§
§stream_id: StreamId
The ID of the stream with which this frame is associated.
stream_dep: Option<StreamDependency>
The stream dependency information, if any.
header_block: HeaderBlock
The header block fragment
flags: HeadersFlag
The associated flags
Implementations§
source§impl Headers
impl Headers
sourcepub fn new(stream_id: StreamId, pseudo: Pseudo, fields: HeaderMap) -> Self
pub fn new(stream_id: StreamId, pseudo: Pseudo, fields: HeaderMap) -> Self
Create a new HEADERS frame
pub fn trailers(stream_id: StreamId, fields: HeaderMap) -> Self
sourcepub fn load(head: Head, src: BytesMut) -> Result<(Self, BytesMut), Error>
pub fn load(head: Head, src: BytesMut) -> Result<(Self, BytesMut), Error>
Loads the header frame but doesn’t actually do HPACK decoding.
HPACK decoding is done in the load_hpack
step.
pub fn load_hpack( &mut self, src: &mut BytesMut, max_header_list_size: usize, decoder: &mut Decoder, ) -> Result<(), Error>
pub fn stream_id(&self) -> StreamId
pub fn is_end_headers(&self) -> bool
pub fn set_end_headers(&mut self)
pub fn is_end_stream(&self) -> bool
pub fn set_end_stream(&mut self)
pub fn is_over_size(&self) -> bool
pub fn into_parts(self) -> (Pseudo, HeaderMap)
sourcepub(crate) fn is_informational(&self) -> bool
pub(crate) fn is_informational(&self) -> bool
Whether it has status 1xx
pub fn fields(&self) -> &HeaderMap
pub fn into_fields(self) -> HeaderMap
pub fn encode( self, encoder: &mut Encoder, dst: &mut Limit<&'_ mut BytesMut>, ) -> Option<Continuation>
fn head(&self) -> Head
Trait Implementations§
impl Eq for Headers
impl StructuralPartialEq for Headers
Auto Trait Implementations§
impl !Freeze for Headers
impl RefUnwindSafe for Headers
impl Send for Headers
impl Sync for Headers
impl Unpin for Headers
impl UnwindSafe for Headers
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.