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
sourceimpl 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.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Pool
impl Send for Pool
impl Sync for Pool
impl Unpin for Pool
impl UnwindSafe for Pool
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more