pub enum Rule {
Prefix(PrefixMatcher),
String(StringMatcher),
Url(UrlMatcher),
}
Available on crate feature
registry
only.Expand description
A Rule is used to check if some input matches the given criteria.
Variants§
Prefix(PrefixMatcher)
Checks the prefix of the given input.
String(StringMatcher)
Checks raw string inputs.
Url(UrlMatcher)
Checks URL inputs.
Implementations§
Source§impl Rule
impl Rule
Sourcepub fn prefix<S>(prefix: S) -> Self
pub fn prefix<S>(prefix: S) -> Self
Looks for prefix substrings. This is mainly useful for attaching a custom protocol that can force a specific type of handler to be used.
Sourcepub fn any_string() -> Self
pub fn any_string() -> Self
Matches any string (non-URL) input.
Sourcepub fn url_scheme<M>(scheme: M) -> Self
pub fn url_scheme<M>(scheme: M) -> Self
Matches a specific URL scheme.
Sourcepub fn url_domain<M>(domain: M) -> Self
pub fn url_domain<M>(domain: M) -> Self
Matches a specific URL domain.
Sourcepub fn http_domain<M>(domain: M) -> Self
pub fn http_domain<M>(domain: M) -> Self
Matches a specific domain for any HTTP or HTTPS URL.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnwindSafe for Rule
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