pub struct UrlPattern { /* private fields */ }Expand description
A compiled scheme://host[:port][/path] pattern. Each part is a glob;
a port of * takes any port, no port takes only the scheme’s default,
and no path is /.
Implementations§
Source§impl UrlPattern
impl UrlPattern
Sourcepub fn parse(pattern: &str) -> Result<Self, String>
pub fn parse(pattern: &str) -> Result<Self, String>
Err for text that is not scheme://host[:port][/path]. A ? or #
is refused rather than read as a wildcard: in a URL it opens the query
or fragment, and the text of a URL with a query (what “permit always”
records) must not match other URLs.
pub fn matches(&self, url: &NormalizedUrl) -> bool
Sourcepub fn host_is_open(&self) -> bool
pub fn host_is_open(&self) -> bool
Whether the host part pins no domain: it has a wildcard, and the labels
written out after the last one holding a wildcard are not a domain
someone registered but a public suffix (*, *.com, *.co.uk,
*.github.io, api.*, *example.com) or numbers (*.0.0.1) — so it
reaches hosts anyone can register or address.
Trait Implementations§
Source§impl Clone for UrlPattern
impl Clone for UrlPattern
Auto Trait Implementations§
impl Forget for UrlPattern
impl Freeze for UrlPattern
impl Move 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