pub struct ConnectionPolicy {
pub pattern: HostPattern,
pub allow: bool,
}Expand description
Allow or deny outbound connections to a host (or hosts matching a regex). Policies are evaluated in order; the first matching policy wins. If no policy matches and rules exist, the connection is denied (allowlist behavior).
Fields§
§pattern: HostPattern§allow: boolIf true, allow the connection; if false, deny (proxy returns an error to the client).
Implementations§
Source§impl ConnectionPolicy
impl ConnectionPolicy
Sourcepub fn allow(pattern: HostPattern) -> Self
pub fn allow(pattern: HostPattern) -> Self
Create an allow rule for the given host pattern.
Sourcepub fn deny(pattern: HostPattern) -> Self
pub fn deny(pattern: HostPattern) -> Self
Create a deny rule for the given host pattern.
Trait Implementations§
Source§impl Clone for ConnectionPolicy
impl Clone for ConnectionPolicy
Source§fn clone(&self) -> ConnectionPolicy
fn clone(&self) -> ConnectionPolicy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ConnectionPolicy
impl RefUnwindSafe for ConnectionPolicy
impl Send for ConnectionPolicy
impl Sync for ConnectionPolicy
impl Unpin for ConnectionPolicy
impl UnsafeUnpin for ConnectionPolicy
impl UnwindSafe for ConnectionPolicy
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