pub struct Pattern { /* private fields */ }
Expand description
A wrapper for a URL pattern, which can be used to match URLs and extract data from them.
Implementations§
Source§impl Pattern
impl Pattern
Sourcepub fn test(&self, other: impl TryInto<Pattern>) -> Result<bool, PatternError>
pub fn test(&self, other: impl TryInto<Pattern>) -> Result<bool, PatternError>
Compare a pattern frame to a material frame, to try and see if the pattern
can capture anything from the material frame. If it can, this returns a
UrlPatternResult
which contains the capture data.
Sourcepub fn captures(&self, other: impl TryInto<Pattern>) -> Option<UrlPatternResult>
pub fn captures(&self, other: impl TryInto<Pattern>) -> Option<UrlPatternResult>
Compare a pattern frame to a material frame, to try and see if the pattern
can capture anything from the material frame. If it can, this returns a
UrlPatternResult
which contains the capture data.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Pattern
impl<'de> Deserialize<'de> for Pattern
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Pattern
impl StructuralPartialEq for Pattern
Auto Trait Implementations§
impl !Freeze for Pattern
impl RefUnwindSafe for Pattern
impl Send for Pattern
impl Sync for Pattern
impl Unpin for Pattern
impl UnwindSafe for Pattern
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