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

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

Fields

includes: Option<Includes>

URIs explicitly included for checking. This takes precedence over excludes

excludes: Option<Excludes>

URIs excluded from checking

schemes: HashSet<String>

Only check URIs with the given schemes (e.g. https and http)

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

Whether e-mails aren’t checked

Whether the IP address is excluded from checking

Whether the host is excluded from checking

Whether the scheme of the given URI is excluded

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 host 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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more