Struct cap_primitives::net::Pool
source · pub struct Pool { /* private fields */ }
Expand description
A representation of a set of network resources that may be accessed.
This is presently a very simple concept, though it could grow in sophistication in the future.
Implementations§
source§impl Pool
impl Pool
sourcepub fn insert_ip_net(&mut self, ip_net: IpNet, port: u16, _: AmbientAuthority)
pub fn insert_ip_net(&mut self, ip_net: IpNet, port: u16, _: AmbientAuthority)
Add a range of network addresses with a specific port to the pool.
Ambient Authority
This function allows ambient access to any IP address.
sourcepub fn insert_socket_addr(&mut self, addr: SocketAddr, _: AmbientAuthority)
pub fn insert_socket_addr(&mut self, addr: SocketAddr, _: AmbientAuthority)
Add a specific net::SocketAddr
to the pool.
Ambient Authority
This function allows ambient access to any IP address.
sourcepub fn check_addr(&self, addr: &SocketAddr) -> Result<()>
pub fn check_addr(&self, addr: &SocketAddr) -> Result<()>
Check whether the given address is within the pool.