[−][src]Struct solicit::http::frame::settings::SettingsFrame
A struct representing the SETTINGS frames of HTTP/2, as defined in the HTTP/2 spec, section 6.5.
The struct does not try to prevent the client from creating malformed SETTINGS frames, such as ones that have the ACK flag set along with some settings values. The users are responsible to follow the prescribed rules before sending the frame to the peer.
On parsing received frames, it treats the following as errors:
- ACK flag and a number of settings both set
- Payload length not a multiple of 6
- Stream ID not zero (SETTINGS frames MUST be associated to stream 0)
What is not treated as an error (for now) are settings values out of allowed bounds such as a EnablePush being set to something other than 0 or 1.
Fields
settings: Vec<HttpSetting>
Contains all the settings that are currently set in the frame. It is
safe to access this field (to read, add, or remove settings), even
though a helper method add_setting
exists.
Implementations
impl SettingsFrame
[src]
pub fn new() -> SettingsFrame
[src]
Creates a new SettingsFrame
pub fn new_ack() -> SettingsFrame
[src]
A convenience constructor that returns a SettingsFrame
with the ACK
flag already set and no settings.
pub fn add_setting(&mut self, setting: HttpSetting)
[src]
Adds the given setting to the frame.
pub fn set_ack(&mut self)
[src]
Sets the ACK flag for the frame. This method is just a convenience
method for calling frame.set_flag(SettingsFlag::Ack)
.
pub fn is_ack(&self) -> bool
[src]
Checks whether the SettingsFrame
has an ACK attached to it.
pub fn set_flag(&mut self, flag: SettingsFlag)
[src]
Sets the given flag for the frame.
Trait Implementations
impl Clone for SettingsFrame
[src]
fn clone(&self) -> SettingsFrame
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for SettingsFrame
[src]
impl<'a> Frame<'a> for SettingsFrame
[src]
type FlagType = SettingsFlag
The type that represents the flags that the particular Frame
can take.
This makes sure that only valid Flag
s are used with each Frame
.
fn from_raw(raw_frame: &RawFrame) -> Option<SettingsFrame>
[src]
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]
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 FrameIR for SettingsFrame
[src]
fn serialize_into<B: FrameBuilder>(self, b: &mut B) -> Result<()>
[src]
impl PartialEq<SettingsFrame> for SettingsFrame
[src]
fn eq(&self, other: &SettingsFrame) -> bool
[src]
fn ne(&self, other: &SettingsFrame) -> bool
[src]
impl StructuralPartialEq for SettingsFrame
[src]
Auto Trait Implementations
impl RefUnwindSafe for SettingsFrame
impl Send for SettingsFrame
impl Sync for SettingsFrame
impl Unpin for SettingsFrame
impl UnwindSafe for SettingsFrame
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,