Skip to main content

RemoteAddr

Trait RemoteAddr 

Source
pub trait RemoteAddr:
    Clone
    + Eq
    + Hash {
    // Required method
    fn same_host(&self, other: &Self) -> bool;
}
Expand description

An address that can key a session in a SoeMultiplexer.

The same_host method lets the multiplexer honour the reference’s port-remap security rule (only the port of an established session may change, never the host) without hard-coding a concrete address type.

Required Methods§

Source

fn same_host(&self, other: &Self) -> bool

Returns whether self and other refer to the same host, ignoring any port component. Used to guard port remaps against session hijacking.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl RemoteAddr for SocketAddr

Source§

fn same_host(&self, other: &Self) -> bool

Implementors§