pub struct Frame<T> { /* private fields */ }
Expand description
A frame of any kind related to an HTTP stream (body).
Implementations§
source§impl<T> Frame<T>
impl<T> Frame<T>
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) -> Result<HeaderMap, Self>
pub fn into_trailers(self) -> Result<HeaderMap, Self>
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.