pub struct Frame<T> { /* private fields */ }
Expand description
A frame of any kind related to an HTTP stream (body).
Implementations
sourceimpl<T> Frame<T>
impl<T> Frame<T>
sourcepub fn into_data(self) -> Option<T>
pub fn into_data(self) -> Option<T>
Consumes self into the buf of the DATA frame.
Check Frame::is_data
before to determine if the frame is DATA.
sourcepub fn data_ref(&self) -> Option<&T>
pub fn data_ref(&self) -> Option<&T>
If this is a DATA frame, returns a reference to it.
Returns None
if not a DATA frame.
sourcepub fn data_mut(&mut self) -> Option<&mut T>
pub fn data_mut(&mut self) -> Option<&mut T>
If this is a DATA frame, returns a mutable reference to it.
Returns None
if not a DATA frame.
sourcepub fn is_trailers(&self) -> bool
pub fn is_trailers(&self) -> bool
Returns whether this is a trailers frame.
sourcepub fn into_trailers(self) -> Option<HeaderMap>
pub fn into_trailers(self) -> Option<HeaderMap>
Consumes self into the buf of the trailers frame.
Check Frame::is_trailers
before to determine if the frame is a trailers frame.
sourcepub fn trailers_ref(&self) -> Option<&HeaderMap>
pub fn trailers_ref(&self) -> Option<&HeaderMap>
If this is a trailers frame, returns a reference to it.
Returns None
if not a trailers frame.
sourcepub fn trailers_mut(&mut self) -> Option<&mut HeaderMap>
pub fn trailers_mut(&mut self) -> Option<&mut HeaderMap>
If this is a trailers frame, returns a mutable reference to it.
Returns None
if not a trailers frame.
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for Frame<T>where
T: RefUnwindSafe,
impl<T> Send for Frame<T>where
T: Send,
impl<T> Sync for Frame<T>where
T: Sync,
impl<T> Unpin for Frame<T>where
T: Unpin,
impl<T> UnwindSafe for Frame<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more