Struct product_os_http_body::Frame
source · 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