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 map_data<F, D>(self, f: F) -> Frame<D>where
F: FnOnce(T) -> D,
pub fn map_data<F, D>(self, f: F) -> Frame<D>where
F: FnOnce(T) -> D,
Maps this frame’s data to a different type.
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, Frame<T>>
pub fn into_trailers(self) -> Result<HeaderMap, Frame<T>>
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> Freeze for Frame<T>where
T: Freeze,
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more