pub struct RequestExt<B> { /* private fields */ }
Expand description
extension types for Request
Implementations§
Source§impl<B> RequestExt<B>
impl<B> RequestExt<B>
Sourcepub fn socket_addr(&self) -> &SocketAddr
pub fn socket_addr(&self) -> &SocketAddr
retrieve remote peer’s socket address.
§Default
std::net::Ipv4Addr::UNSPECIFIED is used for representing peers that can’t provide it’s socket address.
Sourcepub fn socket_addr_mut(&mut self) -> &mut SocketAddr
pub fn socket_addr_mut(&mut self) -> &mut SocketAddr
exclusive version of RequestExt::socket_addr
Sourcepub fn map_body<F, B1>(self, func: F) -> RequestExt<B1>where
F: FnOnce(B) -> B1,
pub fn map_body<F, B1>(self, func: F) -> RequestExt<B1>where
F: FnOnce(B) -> B1,
map body type of self to another type with given function closure.
Sourcepub fn replace_body<B1>(self, body: B1) -> (RequestExt<B1>, B)
pub fn replace_body<B1>(self, body: B1) -> (RequestExt<B1>, B)
replace body type of self with another type and return new type of Self and original body type in tuple.
Trait Implementations§
Source§impl<B> Borrow<SocketAddr> for RequestExt<B>
impl<B> Borrow<SocketAddr> for RequestExt<B>
Source§fn borrow(&self) -> &SocketAddr
fn borrow(&self) -> &SocketAddr
Immutably borrows from an owned value. Read more
Source§impl<B> Clone for RequestExt<B>where
B: Clone,
impl<B> Clone for RequestExt<B>where
B: Clone,
Source§impl<B: Debug> Debug for RequestExt<B>
impl<B: Debug> Debug for RequestExt<B>
Source§impl<B> Default for RequestExt<B>where
B: Default,
impl<B> Default for RequestExt<B>where
B: Default,
Source§impl<B> Stream for RequestExt<B>where
B: Stream,
impl<B> Stream for RequestExt<B>where
B: Stream,
impl<'__pin, B> Unpin for RequestExt<B>where
PinnedFieldsOf<__Origin<'__pin, B>>: Unpin,
Auto Trait Implementations§
impl<B> Freeze for RequestExt<B>where
B: Freeze,
impl<B> RefUnwindSafe for RequestExt<B>where
B: RefUnwindSafe,
impl<B> Send for RequestExt<B>where
B: Send,
impl<B> Sync for RequestExt<B>where
B: Sync,
impl<B> UnwindSafe for RequestExt<B>where
B: 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