pub struct UrlMatch {
pub pattern: UrlPattern,
pub label: Option<String>,
pub user_data: Option<UserData>,
pub method: Option<Method>,
pub headers: Option<HeaderMap>,
}Expand description
A URL pattern with request fields to apply when it matches.
§Examples
use millipede_core::{
link_extraction::UrlMatch,
request::{HeaderMap, Method, UserData},
};
let matched = UrlMatch::new("**/products/*")
.label("product")
.user_data(UserData::default())
.method(Method::POST)
.headers(HeaderMap::new());
assert_eq!(matched.label.as_deref(), Some("product"));Fields§
§pattern: UrlPatternThe URL pattern to match.
label: Option<String>An optional route label applied to matching requests.
user_data: Option<UserData>Optional user data applied to matching requests.
method: Option<Method>An optional HTTP method applied to matching requests.
headers: Option<HeaderMap>Optional HTTP headers applied to matching requests.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UrlMatch
impl RefUnwindSafe for UrlMatch
impl Send for UrlMatch
impl Sync for UrlMatch
impl Unpin for UrlMatch
impl UnsafeUnpin for UrlMatch
impl UnwindSafe for UrlMatch
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