Struct h2::frame::headers::PushPromise
source · pub struct PushPromise {
stream_id: StreamId,
promised_id: StreamId,
header_block: HeaderBlock,
flags: PushPromiseFlag,
}
Fields§
§stream_id: StreamId
The ID of the stream with which this frame is associated.
promised_id: StreamId
The ID of the stream being reserved by this PushPromise.
header_block: HeaderBlock
The header block fragment
flags: PushPromiseFlag
The associated flags
Implementations§
source§impl PushPromise
impl PushPromise
pub fn new( stream_id: StreamId, promised_id: StreamId, pseudo: Pseudo, fields: HeaderMap, ) -> Self
pub fn validate_request(req: &Request<()>) -> Result<(), PushPromiseHeaderError>
fn safe_and_cacheable(method: &Method) -> bool
pub fn fields(&self) -> &HeaderMap
sourcepub fn load(head: Head, src: BytesMut) -> Result<(Self, BytesMut), Error>
pub fn load(head: Head, src: BytesMut) -> Result<(Self, BytesMut), Error>
Loads the push promise 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 promised_id(&self) -> StreamId
pub fn is_end_headers(&self) -> bool
pub fn set_end_headers(&mut self)
pub fn is_over_size(&self) -> bool
pub fn encode( self, encoder: &mut Encoder, dst: &mut Limit<&'_ mut BytesMut>, ) -> Option<Continuation>
fn head(&self) -> Head
sourcepub fn into_parts(self) -> (Pseudo, HeaderMap)
pub fn into_parts(self) -> (Pseudo, HeaderMap)
Consume self
, returning the parts of the frame
Trait Implementations§
source§impl Debug for PushPromise
impl Debug for PushPromise
source§impl<T> From<PushPromise> for Frame<T>
impl<T> From<PushPromise> for Frame<T>
source§fn from(src: PushPromise) -> Self
fn from(src: PushPromise) -> Self
Converts to this type from the input type.
source§impl PartialEq for PushPromise
impl PartialEq for PushPromise
source§fn eq(&self, other: &PushPromise) -> bool
fn eq(&self, other: &PushPromise) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for PushPromise
impl StructuralPartialEq for PushPromise
Auto Trait Implementations§
impl !Freeze for PushPromise
impl RefUnwindSafe for PushPromise
impl Send for PushPromise
impl Sync for PushPromise
impl Unpin for PushPromise
impl UnwindSafe for PushPromise
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.