#[non_exhaustive]pub enum UrlPattern {
Glob(String),
Regex(Regex),
}Expand description
A URL include or exclude pattern.
String conversions create UrlPattern::Glob values, while compiled regular
expressions can be converted without recompilation.
§Examples
use millipede_core::link_extraction::UrlPattern;
let pattern = UrlPattern::from("**/products/*");
assert!(matches!(pattern, UrlPattern::Glob(_)));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Glob(String)
A minimatch-style glob matched against the complete URL string.
Regex(Regex)
A regular expression matched against the complete URL string.
Trait Implementations§
Source§impl Clone for UrlPattern
impl Clone for UrlPattern
Source§fn clone(&self) -> UrlPattern
fn clone(&self) -> UrlPattern
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 moreSource§impl Debug for UrlPattern
impl Debug for UrlPattern
Source§impl From<&str> for UrlPattern
impl From<&str> for UrlPattern
Source§impl From<Regex> for UrlPattern
impl From<Regex> for UrlPattern
Auto Trait Implementations§
impl Freeze for UrlPattern
impl RefUnwindSafe for UrlPattern
impl Send for UrlPattern
impl Sync for UrlPattern
impl Unpin for UrlPattern
impl UnsafeUnpin for UrlPattern
impl UnwindSafe for UrlPattern
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