[][src]Struct solicit::http::frame::headers::HeadersFrame

pub struct HeadersFrame<'a> {
    pub stream_id: StreamId,
    pub stream_dep: Option<StreamDependency>,
    pub padding_len: Option<u8>,
    // some fields omitted
}

A struct representing the HEADERS frames of HTTP/2, as defined in the HTTP/2 spec, section 6.2.

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.

padding_len: Option<u8>

The length of the padding, if any.

Implementations

impl<'a> HeadersFrame<'a>[src]

pub fn new(fragment: Vec<u8>, stream_id: StreamId) -> HeadersFrame<'a>[src]

Creates a new HeadersFrame with the given header fragment and stream ID. No padding, no stream dependency, and no flags are set.

pub fn with_dependency(
    fragment: Vec<u8>,
    stream_id: StreamId,
    stream_dep: StreamDependency
) -> HeadersFrame<'a>
[src]

Creates a new HeadersFrame with the given header fragment, stream ID and stream dependency information. No padding and no flags are set.

pub fn is_headers_end(&self) -> bool[src]

Returns whether this frame ends the headers. If not, there MUST be a number of follow up CONTINUATION frames that send the rest of the header data.

pub fn is_end_of_stream(&self) -> bool[src]

Returns whther this frame ends the stream it is associated with.

pub fn set_padding(&mut self, padding_len: u8)[src]

Sets the padding length for the frame, as well as the corresponding Padded flag.

pub fn header_fragment(&self) -> &[u8][src]

pub fn set_flag(&mut self, flag: HeadersFlag)[src]

Sets the given flag for the frame.

Trait Implementations

impl<'a> Clone for HeadersFrame<'a>[src]

impl<'a> Debug for HeadersFrame<'a>[src]

impl<'a> Frame<'a> for HeadersFrame<'a>[src]

type FlagType = HeadersFlag

The type that represents the flags that the particular Frame can take. This makes sure that only valid Flags are used with each Frame.

fn from_raw(raw_frame: &'a RawFrame) -> Option<HeadersFrame<'a>>[src]

Creates a new HeadersFrame with the given RawFrame (i.e. header and payload), if possible.

Returns

None if a valid HeadersFrame cannot be constructed from the given RawFrame. The stream ID must not be 0.

Otherwise, returns a newly constructed HeadersFrame.

fn is_set(&self, flag: HeadersFlag) -> bool[src]

Tests if the given flag is set for the frame.

fn get_stream_id(&self) -> StreamId[src]

Returns the StreamId of the stream to which the frame is associated.

A SettingsFrame always has to be associated to stream 0.

fn get_header(&self) -> FrameHeader[src]

Returns a FrameHeader based on the current state of the Frame.

impl<'a> FrameIR for HeadersFrame<'a>[src]

impl<'a> PartialEq<HeadersFrame<'a>> for HeadersFrame<'a>[src]

impl<'a> StructuralPartialEq for HeadersFrame<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for HeadersFrame<'a>

impl<'a> Send for HeadersFrame<'a>

impl<'a> Sync for HeadersFrame<'a>

impl<'a> Unpin for HeadersFrame<'a>

impl<'a> UnwindSafe for HeadersFrame<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.