pub struct ConnectionInfo {
pub client: Address,
pub server: Address,
pub request_size: i64,
pub sni_hostname: Option<String>,
}Expand description
Network context for the current connection, passed into every Controller.
Fields§
§client: AddressClient (peer) address.
server: AddressServer (local) address.
request_size: i64Bytes allocated for reading the request.
sni_hostname: Option<String>SNI hostname sent by the client during the TLS handshake, if any.
None for plain-HTTP connections or when the client omits SNI.
Implementations§
Source§impl ConnectionInfo
impl ConnectionInfo
Sourcepub fn peer_addr(&self) -> Option<SocketAddr>
pub fn peer_addr(&self) -> Option<SocketAddr>
Parse the client address into a std::net::SocketAddr, if the stored
IP and port are valid. Returns None if parsing fails.
Trait Implementations§
Source§impl Clone for ConnectionInfo
impl Clone for ConnectionInfo
Source§fn clone(&self) -> ConnectionInfo
fn clone(&self) -> ConnectionInfo
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ConnectionInfo
impl RefUnwindSafe for ConnectionInfo
impl Send for ConnectionInfo
impl Sync for ConnectionInfo
impl Unpin for ConnectionInfo
impl UnsafeUnpin for ConnectionInfo
impl UnwindSafe for ConnectionInfo
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