[−][src]Trait solicit::http::frame::Frame
A trait that all HTTP/2 frame structs need to implement.
Associated Types
type FlagType: Flag
The type that represents the flags that the particular Frame can take.
This makes sure that only valid Flags are used with each Frame.
Required Methods
fn from_raw(raw_frame: RawFrame) -> Option<Self>
Creates a new Frame from the given RawFrame (i.e. header and
payload), if possible.
Returns
None if a valid Frame cannot be constructed from the given
RawFrame. Some reasons why this may happen is a wrong frame type in
the header, a body that cannot be decoded according to the particular
frame's rules, etc.
Otherwise, returns a newly constructed Frame.
fn is_set(&self, flag: Self::FlagType) -> bool
Tests if the given flag is set for the frame.
fn get_stream_id(&self) -> StreamId
Returns the StreamId of the stream to which the frame is associated
fn get_header(&self) -> FrameHeader
Returns a FrameHeader based on the current state of the Frame.
fn set_flag(&mut self, flag: Self::FlagType)
Sets the given flag for the frame.
fn serialize(&self) -> Vec<u8>
Returns a Vec with the serialized representation of the frame.
Implementors
impl Frame for DataFrame[src]
impl Frame for DataFrametype FlagType = DataFlag
fn from_raw(raw_frame: RawFrame) -> Option<DataFrame>[src]
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.
fn is_set(&self, flag: DataFlag) -> bool[src]
fn is_set(&self, flag: DataFlag) -> boolTests if the given flag is set for the frame.
fn set_flag(&mut self, flag: DataFlag)[src]
fn set_flag(&mut self, flag: DataFlag)Sets the given flag for the frame.
fn get_stream_id(&self) -> StreamId[src]
fn get_stream_id(&self) -> StreamIdReturns the StreamId of the stream to which the frame is associated.
fn get_header(&self) -> FrameHeader[src]
fn get_header(&self) -> FrameHeaderReturns a FrameHeader based on the current state of the frame.
fn serialize(&self) -> Vec<u8>[src]
fn serialize(&self) -> Vec<u8>Returns a Vec with the serialized representation of the frame.
impl Frame for HeadersFrame[src]
impl Frame for HeadersFrametype 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: RawFrame) -> Option<HeadersFrame>[src]
fn from_raw(raw_frame: RawFrame) -> Option<HeadersFrame>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]
fn is_set(&self, flag: HeadersFlag) -> boolTests if the given flag is set for the frame.
fn get_stream_id(&self) -> StreamId[src]
fn get_stream_id(&self) -> StreamIdReturns 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]
fn get_header(&self) -> FrameHeaderReturns a FrameHeader based on the current state of the Frame.
fn set_flag(&mut self, flag: HeadersFlag)[src]
fn set_flag(&mut self, flag: HeadersFlag)Sets the given flag for the frame.
fn serialize(&self) -> Vec<u8>[src]
fn serialize(&self) -> Vec<u8>Returns a Vec with the serialized representation of the frame.
Panics
If the HeadersFlag::Priority flag was set, but no stream dependency
information is given (i.e. stream_dep is None).
impl Frame for SettingsFrame[src]
impl Frame for SettingsFrametype FlagType = SettingsFlag
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: RawFrame) -> Option<SettingsFrame>[src]
fn from_raw(raw_frame: RawFrame) -> Option<SettingsFrame>Creates a new SettingsFrame with the given RawFrame (i.e. header and
payload), if possible.
Returns
None if a valid SettingsFrame cannot be constructed from the given
RawFrame. The stream ID must be 0 in order for the frame to be
valid. If the ACK flag is set, there MUST not be a payload. The
total payload length must be multiple of 6.
Otherwise, returns a newly constructed SettingsFrame.
fn is_set(&self, flag: SettingsFlag) -> bool[src]
fn is_set(&self, flag: SettingsFlag) -> boolTests if the given flag is set for the frame.
fn get_stream_id(&self) -> StreamId[src]
fn get_stream_id(&self) -> StreamIdReturns 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]
fn get_header(&self) -> FrameHeaderReturns a FrameHeader based on the current state of the Frame.
fn set_flag(&mut self, flag: SettingsFlag)[src]
fn set_flag(&mut self, flag: SettingsFlag)Sets the given flag for the frame.
fn serialize(&self) -> Vec<u8>[src]
fn serialize(&self) -> Vec<u8>Returns a Vec with the serialized representation of the frame.