[−][src]Struct solicit::http::frame::data::DataFrame
A struct representing the DATA frames of HTTP/2, as defined in the HTTP/2 spec, section 6.1.
Fields
data: Cow<'a, [u8]>
The data found in the frame as an opaque byte sequence. It never includes padding bytes.
Implementations
impl<'a> DataFrame<'a>
[src]
pub fn new(stream_id: StreamId) -> DataFrame<'a>
[src]
Creates a new empty DataFrame
, associated to the stream with the
given ID.
pub fn with_data<D: Into<DataChunk<'a>>>(
stream_id: StreamId,
data: D
) -> DataFrame<'a>
[src]
stream_id: StreamId,
data: D
) -> DataFrame<'a>
Creates a new DataFrame
with the given DataChunk
.
The chunk can be any type that can be converted into a DataChunk
instance and, as such,
can either pass ownership of the buffer to the DataFrame or provide a temporary borrow.
pub fn is_padded(&self) -> bool
[src]
Returns true
if the DATA frame is padded, otherwise false.
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, pad_len: u8)
[src]
Sets the number of bytes that should be used as padding for this frame.
pub fn payload_len(&self) -> u32
[src]
Returns the total length of the payload, taking into account possible padding.
pub fn set_flag(&mut self, flag: DataFlag)
[src]
Sets the given flag for the frame.
Trait Implementations
impl<'a> Clone for DataFrame<'a>
[src]
impl<'a> Debug for DataFrame<'a>
[src]
impl<'a> Frame<'a> for DataFrame<'a>
[src]
type FlagType = DataFlag
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
. Read more
fn from_raw(raw_frame: &'a RawFrame<'a>) -> Option<DataFrame<'a>>
[src]
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]
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.
fn get_header(&self) -> FrameHeader
[src]
Returns a FrameHeader
based on the current state of the frame.
impl<'a> FrameIR for DataFrame<'a>
[src]
fn serialize_into<B: FrameBuilder>(self, b: &mut B) -> Result<()>
[src]
impl<'a> PartialEq<DataFrame<'a>> for DataFrame<'a>
[src]
impl<'a> StructuralPartialEq for DataFrame<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for DataFrame<'a>
impl<'a> Send for DataFrame<'a>
impl<'a> Sync for DataFrame<'a>
impl<'a> Unpin for DataFrame<'a>
impl<'a> UnwindSafe for DataFrame<'a>
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>,