Struct poem::web::RemoteAddr
source · pub struct RemoteAddr(pub Addr);
Expand description
Remote peer’s address.
Tuple Fields§
§0: Addr
Methods from Deref<Target = Addr>§
sourcepub fn as_socket_addr(&self) -> Option<&SocketAddr>
pub fn as_socket_addr(&self) -> Option<&SocketAddr>
If the address is a internet socket address, returns it. Returns None otherwise.
sourcepub fn as_unix_socket_addr(&self) -> Option<&SocketAddr>
Available on Unix only.
pub fn as_unix_socket_addr(&self) -> Option<&SocketAddr>
If the address is a unix socket address, returns it. Returns None otherwise.
Trait Implementations§
source§impl Clone for RemoteAddr
impl Clone for RemoteAddr
source§fn clone(&self) -> RemoteAddr
fn clone(&self) -> RemoteAddr
Returns a copy 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 Debug for RemoteAddr
impl Debug for RemoteAddr
source§impl Default for RemoteAddr
impl Default for RemoteAddr
source§fn default() -> RemoteAddr
fn default() -> RemoteAddr
Returns the “default value” for a type. Read more
source§impl Deref for RemoteAddr
impl Deref for RemoteAddr
source§impl Display for RemoteAddr
impl Display for RemoteAddr
source§impl<'a> FromRequest<'a> for &'a RemoteAddr
impl<'a> FromRequest<'a> for &'a RemoteAddr
source§async fn from_request(req: &'a Request, _body: &mut RequestBody) -> Result<Self>
async fn from_request(req: &'a Request, _body: &mut RequestBody) -> Result<Self>
Extract from request head and body.
source§impl PartialEq for RemoteAddr
impl PartialEq for RemoteAddr
source§fn eq(&self, other: &RemoteAddr) -> bool
fn eq(&self, other: &RemoteAddr) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for RemoteAddr
Auto Trait Implementations§
impl Freeze for RemoteAddr
impl RefUnwindSafe for RemoteAddr
impl Send for RemoteAddr
impl Sync for RemoteAddr
impl Unpin for RemoteAddr
impl UnwindSafe for RemoteAddr
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> TowerCompatExt for T
impl<T> TowerCompatExt for T
source§fn compat<ResBody, Err, Fut>(self) -> TowerCompatEndpoint<Self>where
ResBody: Body + Send + Sync + 'static,
ResBody::Data: Into<Bytes> + Send + 'static,
ResBody::Error: StdError + Send + Sync + 'static,
Err: Into<Error>,
Self: Service<Request<BoxBody<Bytes, Error>>, Response = Response<ResBody>, Error = Err, Future = Fut> + Clone + Send + Sync + Sized + 'static,
Fut: Future<Output = Result<Response<ResBody>, Err>> + Send + 'static,
fn compat<ResBody, Err, Fut>(self) -> TowerCompatEndpoint<Self>where
ResBody: Body + Send + Sync + 'static,
ResBody::Data: Into<Bytes> + Send + 'static,
ResBody::Error: StdError + Send + Sync + 'static,
Err: Into<Error>,
Self: Service<Request<BoxBody<Bytes, Error>>, Response = Response<ResBody>, Error = Err, Future = Fut> + Clone + Send + Sync + Sized + 'static,
Fut: Future<Output = Result<Response<ResBody>, Err>> + Send + 'static,
Available on crate feature
tower-compat
only.Converts a tower service to a poem endpoint.