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
pub fn protocol(&self) -> Option<Protocol>
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> Body for RequestExt<B>where
B: Body,
impl<B> Body for RequestExt<B>where
B: Body,
Source§fn poll_frame(
self: Pin<&mut RequestExt<B>>,
cx: &mut Context<'_>,
) -> Poll<Option<Result<Frame<<RequestExt<B> as Body>::Data>, <RequestExt<B> as Body>::Error>>>
fn poll_frame( self: Pin<&mut RequestExt<B>>, cx: &mut Context<'_>, ) -> Poll<Option<Result<Frame<<RequestExt<B> as Body>::Data>, <RequestExt<B> as Body>::Error>>>
Attempt to pull the next frame from the body. Read more
Source§fn is_end_stream(&self) -> bool
fn is_end_stream(&self) -> bool
Indicates whether the body has been fully consumed. Read more
Source§impl<B> Borrow<Params> for RequestExt<B>
impl<B> Borrow<Params> for RequestExt<B>
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> BorrowMut<Params> for RequestExt<B>
impl<B> BorrowMut<Params> for RequestExt<B>
Source§fn borrow_mut(&mut self) -> &mut Params
fn borrow_mut(&mut self) -> &mut Params
Mutably 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§fn clone(&self) -> RequestExt<B>
fn clone(&self) -> RequestExt<B>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<B> Debug for RequestExt<B>where
B: Debug,
impl<B> Debug for RequestExt<B>where
B: Debug,
Source§impl<B> Default for RequestExt<B>where
B: Default,
impl<B> Default for RequestExt<B>where
B: Default,
Source§fn default() -> RequestExt<B>
fn default() -> RequestExt<B>
Returns the “default value” for a type. Read more
Source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for &'a RequestExt<()>
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for &'a RequestExt<()>
type Type<'b> = &'b RequestExt<()>
type Error = Error
async fn from_request( ctx: &'a WebContext<'r, C, B>, ) -> Result<Self, Self::Error>
Source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for RequestExt<()>
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for RequestExt<()>
type Type<'b> = RequestExt<()>
type Error = Error
async fn from_request( ctx: &'a WebContext<'r, C, B>, ) -> Result<Self, Self::Error>
impl<'__pin, B> Unpin for RequestExt<B>where
<PinnedFieldsOfHelperStruct<__Origin<'__pin, B>> as PinnedFieldsOfHelperTrait>::Actual: 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> UnsafeUnpin for RequestExt<B>where
B: UnsafeUnpin,
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