mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-26 15:07:42 +02:00
docs: better docs for peer_addr methods
This commit is contained in:
@ -16,7 +16,10 @@ pub struct RequestHead {
|
||||
pub uri: Uri,
|
||||
pub version: Version,
|
||||
pub headers: HeaderMap,
|
||||
|
||||
/// Will only be None when called in unit tests unless [`TestRequest::peer_addr`] is used.
|
||||
pub peer_addr: Option<net::SocketAddr>,
|
||||
|
||||
flags: Flags,
|
||||
}
|
||||
|
||||
|
@ -173,7 +173,7 @@ impl<P> Request<P> {
|
||||
/// Peer address is the directly connected peer's socket address. If a proxy is used in front of
|
||||
/// the Actix Web server, then it would be address of this proxy.
|
||||
///
|
||||
/// Will only return None when called in unit tests.
|
||||
/// Will only return None when called in unit tests unless set manually.
|
||||
#[inline]
|
||||
pub fn peer_addr(&self) -> Option<net::SocketAddr> {
|
||||
self.head().peer_addr
|
||||
|
Reference in New Issue
Block a user