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 UrlPatternwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Token>: Freeze,
*const ArcInner<RegexI> is !null: Freeze,
PhantomData<ArcInner<RegexI>>: Freeze,
*const Pool<Cache, Box<dyn Fn() -> Cache + Sync + Send + UnwindSafe + RefUnwindSafe>> is !null: Freeze,
PhantomData<Pool<Cache, Box<dyn Fn() -> Cache + Sync + Send + UnwindSafe + RefUnwindSafe>>>: Freeze,
impl Move for UrlPattern
impl RefUnwindSafe for UrlPatternwhere
Atomic<usize>: RefUnwindSafe,
Pool<Cache, Box<dyn Fn() -> Cache + Sync + Send + UnwindSafe + RefUnwindSafe>>: RefUnwindSafe,
impl Send for UrlPattern
impl Sync for UrlPattern
impl Unpin for UrlPattern
impl UnsafeUnpin for UrlPatternwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Token>: UnsafeUnpin,
*const ArcInner<RegexI> is !null: UnsafeUnpin,
PhantomData<ArcInner<RegexI>>: UnsafeUnpin,
*const Pool<Cache, Box<dyn Fn() -> Cache + Sync + Send + UnwindSafe + RefUnwindSafe>> is !null: UnsafeUnpin,
PhantomData<Pool<Cache, Box<dyn Fn() -> Cache + Sync + Send + UnwindSafe + RefUnwindSafe>>>: UnsafeUnpin,
impl UnwindSafe for UrlPatternwhere
RawVecInner: UnwindSafe,
Arc<RegexI>: UnwindSafe,
BoxRaw<Pool<Cache, Box<dyn Fn() -> Cache + Sync + Send + UnwindSafe + RefUnwindSafe>>>: UnwindSafe,
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