pub struct UriPattern<'a> { /* private fields */ }
Expand description
Struct used to parse strings as patterns - Check if an incoming string matches a pattern - Pattern Comparison
Implementations§
Source§impl UriPattern<'_>
impl UriPattern<'_>
Sourcepub fn is_match(&self, candidate: &str) -> bool
pub fn is_match(&self, candidate: &str) -> bool
Method used to check if a candidate string matches against the pattern
§Example
use uri_pattern_matcher::UriPattern;
let pattern: UriPattern = "/api/{resource}/{id}/details".into();
assert!(pattern.is_match("/api/resource/id1/details"));
assert!(pattern.is_match("/api/customer/John/details"));
Trait Implementations§
Source§impl<'a> Clone for UriPattern<'a>
impl<'a> Clone for UriPattern<'a>
Source§fn clone(&self) -> UriPattern<'a>
fn clone(&self) -> UriPattern<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for UriPattern<'a>
impl<'a> Debug for UriPattern<'a>
Source§impl<'a> From<&'a str> for UriPattern<'a>
impl<'a> From<&'a str> for UriPattern<'a>
Source§impl Ord for UriPattern<'_>
impl Ord for UriPattern<'_>
Source§impl PartialEq for UriPattern<'_>
impl PartialEq for UriPattern<'_>
Source§impl PartialOrd for UriPattern<'_>
impl PartialOrd for UriPattern<'_>
impl Eq for UriPattern<'_>
Auto Trait Implementations§
impl<'a> Freeze for UriPattern<'a>
impl<'a> RefUnwindSafe for UriPattern<'a>
impl<'a> Send for UriPattern<'a>
impl<'a> Sync for UriPattern<'a>
impl<'a> Unpin for UriPattern<'a>
impl<'a> UnwindSafe for UriPattern<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)