Struct lychee_lib::Filter[][src]

pub struct Filter {
    pub includes: Option<Includes>,
    pub excludes: Option<Excludes>,
    pub scheme: Option<String>,
    pub exclude_private_ips: bool,
    pub exclude_link_local_ips: bool,
    pub exclude_loopback_ips: bool,
    pub exclude_mail: bool,
}

A generic URI filter Used to decide if a given URI should be checked or skipped

Fields

includes: Option<Includes>excludes: Option<Excludes>scheme: Option<String>exclude_private_ips: bool

Example: 192.168.0.1

exclude_link_local_ips: bool

Example: 169.254.0.0

exclude_loopback_ips: bool

For IPv4: 127.0.0.1/8 For IPv6: ::1/128

exclude_mail: bool

Example: octocat@github.com

Implementations

impl Filter[src]

#[must_use]
pub fn is_mail_excluded(&self, uri: &Uri) -> bool
[src]

#[must_use]
pub fn is_ip_excluded(&self, uri: &Uri) -> bool
[src]

#[must_use]
pub fn is_scheme_excluded(&self, uri: &Uri) -> bool
[src]

#[must_use]
pub fn is_excluded(&self, uri: &Uri) -> bool
[src]

Determine whether a given Uri should be excluded.

Details

  1. If any of the following conditions are met, the URI is excluded:
  • If it’s a mail address and it’s configured to ignore mail addresses.
  • If the IP address belongs to a type that is configured to exclude.
  • If the scheme of URI is not the allowed scheme.
  1. Decide whether the URI is presumably included or explicitly included:
    • When both excludes and includes rules are empty, it’s presumably included unless it’s a known false positive.
    • When the includes rules matches the URI, it’s explicitly included.
  2. When it’s a known false positive pattern, it’s explicitly excluded.
  3. Decide whether the URI is presumably excluded or explicitly excluded:
    • When excludes rules is empty, but includes rules doesn’t match the URI, it’s presumably excluded.
    • When the excludes rules matches the URI, it’s explicitly excluded.
    • When the excludes rules matches the URI, it’s explicitly excluded.

Trait Implementations

impl Clone for Filter[src]

impl Debug for Filter[src]

impl Default for Filter[src]

Auto Trait Implementations

impl RefUnwindSafe for Filter

impl Send for Filter

impl Sync for Filter

impl Unpin for Filter

impl UnwindSafe for Filter

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,