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>
This is supported 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
sourceimpl Clone for RemoteAddr
impl Clone for RemoteAddr
sourcefn clone(&self) -> RemoteAddr
fn clone(&self) -> RemoteAddr
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for RemoteAddr
impl Debug for RemoteAddr
sourceimpl Default for RemoteAddr
impl Default for RemoteAddr
sourcefn default() -> RemoteAddr
fn default() -> RemoteAddr
Returns the “default value” for a type. Read more
sourceimpl Deref for RemoteAddr
impl Deref for RemoteAddr
sourceimpl Display for RemoteAddr
impl Display for RemoteAddr
sourceimpl<'a> FromRequest<'a> for &'a RemoteAddr
impl<'a> FromRequest<'a> for &'a RemoteAddr
sourcefn from_request<'life0, 'async_trait>(
req: &'a Request,
_body: &'life0 mut RequestBody
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>> where
'a: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn from_request<'life0, 'async_trait>(
req: &'a Request,
_body: &'life0 mut RequestBody
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>> where
'a: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Extract from request head and body.
sourceimpl PartialEq<RemoteAddr> for RemoteAddr
impl PartialEq<RemoteAddr> for RemoteAddr
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &RemoteAddr) -> bool
fn ne(&self, other: &RemoteAddr) -> bool
This method tests for !=
.
impl StructuralPartialEq for RemoteAddr
Auto Trait Implementations
impl RefUnwindSafe for RemoteAddr
impl Send for RemoteAddr
impl Sync for RemoteAddr
impl Unpin for RemoteAddr
impl UnwindSafe for RemoteAddr
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> FutureExt for T
impl<T> FutureExt for T
sourcefn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
sourcefn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more