pub struct ConnectionInfo {
pub local_addr: SocketAddr,
pub remote_addr: SocketAddr,
pub scheme: Scheme,
pub tls: Option<TlsInfo>,
}Expand description
Immutable connection metadata for an HTTP request.
Values come from the actual transport. Forwarded and
X-Forwarded-* headers are ordinary untrusted headers and are not
part of this type.
§Separation from headers
Connection metadata is never mixed into request headers. Callers who
need proxy-trusted values should read Forwarded or
X-Forwarded-* headers separately and validate them according to
their trust model.
Fields§
§local_addr: SocketAddrThe local socket address the connection was accepted on.
remote_addr: SocketAddrThe remote socket address of the peer.
scheme: SchemeThe request URI scheme (e.g., http or https).
tls: Option<TlsInfo>TLS session metadata, if the connection is TLS-secured.
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 moreSource§impl Debug for ConnectionInfo
impl Debug for ConnectionInfo
impl Eq for ConnectionInfo
Source§impl PartialEq for ConnectionInfo
impl PartialEq for ConnectionInfo
impl StructuralPartialEq for ConnectionInfo
Auto 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