Struct ajars_actix_web::actix_web::dev::PeerAddr [−][src]
pub struct PeerAddr(pub SocketAddr);
Expand description
Extractor for peer’s socket address.
Also see HttpRequest::peer_addr
.
Examples
use actix_web::dev::PeerAddr;
async fn handler(peer_addr: PeerAddr) -> impl Responder {
let socket_addr = peer_addr.0;
socket_addr.to_string()
}
Tuple Fields
0: SocketAddr
Implementations
Unwrap into inner SocketAddr
value.
Trait Implementations
type Error = MissingPeerAddr
type Error = MissingPeerAddr
The associated error which can be returned.
Future that resolves to a Self.
pub fn from_request(
req: &HttpRequest,
&mut Payload<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>
) -> <PeerAddr as FromRequest>::Future
pub fn from_request(
req: &HttpRequest,
&mut Payload<Pin<Box<dyn Stream<Item = Result<Bytes, PayloadError>> + 'static, Global>>>
) -> <PeerAddr as FromRequest>::Future
Create a Self from request parts asynchronously.
Create a Self from request head asynchronously. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for PeerAddr
impl UnwindSafe for PeerAddr
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self