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_mail_excluded(&self, uri: &Uri) -> bool#[must_use]pub fn is_ip_excluded(&self, uri: &Uri) -> bool
[src]
#[must_use]
pub fn is_ip_excluded(&self, uri: &Uri) -> bool#[must_use]pub fn is_scheme_excluded(&self, uri: &Uri) -> bool
[src]
#[must_use]
pub fn is_scheme_excluded(&self, uri: &Uri) -> bool#[must_use]pub fn is_excluded(&self, uri: &Uri) -> bool
[src]
#[must_use]
pub fn is_excluded(&self, uri: &Uri) -> boolDetermine whether a given Uri
should be excluded.
Details
- 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.
- 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.
- When it’s a known false positive pattern, it’s explicitly excluded.
- 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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,