pub struct Policy { /* private fields */ }Expand description
The destination rules in force for a connection.
Implementations§
Source§impl Policy
impl Policy
Sourcepub fn allows_port(&self, port: u16) -> bool
pub fn allows_port(&self, port: u16) -> bool
Whether a target port may be reached at all.
Checked before name resolution: it needs no address, and refusing early means a denied port cannot be used to make the proxy run DNS lookups.
Sourcepub fn allows_address(&self, ip: IpAddr) -> bool
pub fn allows_address(&self, ip: IpAddr) -> bool
Whether one resolved address may be dialled.
Sourcepub fn allowed_addresses(&self, addresses: &[SocketAddr]) -> Vec<SocketAddr>
pub fn allowed_addresses(&self, addresses: &[SocketAddr]) -> Vec<SocketAddr>
The subset of addresses this proxy may dial.
A name that resolves to both a public and a private address keeps only the public ones, which is what makes DNS rebinding onto loopback pointless.
Auto Trait Implementations§
impl Freeze for Policy
impl RefUnwindSafe for Policy
impl Send for Policy
impl Sync for Policy
impl Unpin for Policy
impl UnsafeUnpin for Policy
impl UnwindSafe for Policy
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