pub enum BypassRule {
Cidr(IpNetwork),
Ip(IpAddr),
Glob(Pattern),
}Expand description
Pre-parsed bypass rule for CIDR / IP / glob hostname matching.
Variants§
Implementations§
Source§impl BypassRule
impl BypassRule
Sourcepub fn parse(raw: &str) -> Result<Self, String>
pub fn parse(raw: &str) -> Result<Self, String>
Parse a raw bypass string.
Supported formats:
cidr:10.0.0.0/8→ CIDR network127.0.0.1→ literal IP*.internal.corp→ glob hostname
Sourcepub fn matches_host(&self, hostname: &str) -> bool
pub fn matches_host(&self, hostname: &str) -> bool
Returns true when hostname (a host name or IP string) should bypass upstream.
Sourcepub fn matches_ip(&self, addr: &IpAddr) -> bool
pub fn matches_ip(&self, addr: &IpAddr) -> bool
Returns true when addr (a raw IP) should bypass upstream (transparent mode).
Trait Implementations§
Source§impl Clone for BypassRule
impl Clone for BypassRule
Source§fn clone(&self) -> BypassRule
fn clone(&self) -> BypassRule
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 BypassRule
impl RefUnwindSafe for BypassRule
impl Send for BypassRule
impl Sync for BypassRule
impl Unpin for BypassRule
impl UnsafeUnpin for BypassRule
impl UnwindSafe for BypassRule
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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