[−][src]Struct solicit::http::frame::headers::StreamDependency
The struct represents the dependency information that can be attached to a stream and sent within a HEADERS frame (one with the Priority flag set).
Fields
stream_id: StreamId
The ID of the stream that a particular stream depends on
weight: u8
The weight for the stream. The value exposed (and set) here is always
in the range [0, 255], instead of [1, 256] (as defined in section 5.3.2.)
so that the value fits into a u8
.
is_exclusive: bool
A flag indicating whether the stream dependency is exclusive.
Methods
impl StreamDependency
[src]
impl StreamDependency
pub fn new(
stream_id: StreamId,
weight: u8,
is_exclusive: bool
) -> StreamDependency
[src]
pub fn new(
stream_id: StreamId,
weight: u8,
is_exclusive: bool
) -> StreamDependency
Creates a new StreamDependency
with the given stream ID, weight, and
exclusivity.
pub fn parse(buf: &[u8]) -> StreamDependency
[src]
pub fn parse(buf: &[u8]) -> StreamDependency
Parses the first 5 bytes in the buffer as a StreamDependency
.
(Each 5-byte sequence is always decodable into a stream dependency
structure).
Panics
If the given buffer has less than 5 elements, the method will panic.
pub fn serialize(&self) -> [u8; 5]
[src]
pub fn serialize(&self) -> [u8; 5]
Serializes the StreamDependency
into a 5-byte buffer representing the
dependency description, as described in section 6.2. of the HTTP/2
spec:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-------------+-----------------------------------------------+
|E| Stream Dependency (31) |
+-+-------------+-----------------------------------------------+
| Weight (8) |
+-+-------------+-----------------------------------------------+
Where "E" is set if the dependency is exclusive.
Trait Implementations
impl Clone for StreamDependency
[src]
impl Clone for StreamDependency
fn clone(&self) -> StreamDependency
[src]
fn clone(&self) -> StreamDependency
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq<StreamDependency> for StreamDependency
[src]
impl PartialEq<StreamDependency> for StreamDependency
fn eq(&self, other: &StreamDependency) -> bool
[src]
fn eq(&self, other: &StreamDependency) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &StreamDependency) -> bool
[src]
fn ne(&self, other: &StreamDependency) -> bool
This method tests for !=
.
impl Debug for StreamDependency
[src]
impl Debug for StreamDependency
Auto Trait Implementations
impl Send for StreamDependency
impl Send for StreamDependency
impl Sync for StreamDependency
impl Sync for StreamDependency
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more