Struct UriMatcher
pub struct UriMatcher { /* private fields */ }Available on crate features
http and std only.Expand description
Matches the request’s URI as text, using a glob (Wildcard: * any run of
bytes, ? any one byte) or a regex.
The text is scheme://authority/path without query and trailing /, or just
the path when the URI has no authority. Unrelated to PathPattern and
UriTemplate: no segments or decoding. Route with the path matcher
(HttpMatcher::path) instead; the uri module compares all URI patterns.
Implementations§
§impl UriMatcher
impl UriMatcher
pub fn regex(re: Regex) -> UriMatcher
pub fn regex(re: Regex) -> UriMatcher
create a new Uri matcher using a regex pattern.
pub fn wildcard(wc: Wildcard<'static>) -> UriMatcher
pub fn wildcard(wc: Wildcard<'static>) -> UriMatcher
create a new Uri matcher using a wildcard pattern.
Trait Implementations§
§impl Clone for UriMatcher
impl Clone for UriMatcher
§fn clone(&self) -> UriMatcher
fn clone(&self) -> UriMatcher
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for UriMatcher
impl Debug for UriMatcher
§impl From<Regex> for UriMatcher
impl From<Regex> for UriMatcher
§fn from(re: Regex) -> UriMatcher
fn from(re: Regex) -> UriMatcher
Converts to this type from the input type.
§impl From<Wildcard<'static>> for UriMatcher
impl From<Wildcard<'static>> for UriMatcher
§fn from(wc: Wildcard<'static>) -> UriMatcher
fn from(wc: Wildcard<'static>) -> UriMatcher
Converts to this type from the input type.
§impl<Body> Matcher<Request<Body>> for UriMatcher
impl<Body> Matcher<Request<Body>> for UriMatcher
§fn matches(&self, _ext: Option<&Extensions>, req: &Request<Body>) -> bool
fn matches(&self, _ext: Option<&Extensions>, req: &Request<Body>) -> bool
returns true on a match, false otherwise Read more
§fn or<M>(self, other: M) -> impl Matcher<Input>
fn or<M>(self, other: M) -> impl Matcher<Input>
Provide an alternative matcher to match if the current one does not match.
Auto Trait Implementations§
impl Forget for UriMatcher
impl Freeze for UriMatcherwhere
*const ArcInner<RegexI> is !null: Freeze,
PhantomData<ArcInner<RegexI>>: Freeze,
*const Pool<Cache, Box<dyn Fn() -> Cache + UnwindSafe + RefUnwindSafe + Send + Sync>> is !null: Freeze,
PhantomData<Pool<Cache, Box<dyn Fn() -> Cache + UnwindSafe + RefUnwindSafe + Send + Sync>>>: Freeze,
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
&'static [u8]: Freeze,
Vec<u8>: Freeze,
impl Move for UriMatcher
impl RefUnwindSafe for UriMatcherwhere
Atomic<usize>: RefUnwindSafe,
Pool<Cache, Box<dyn Fn() -> Cache + UnwindSafe + RefUnwindSafe + Send + Sync>>: RefUnwindSafe,
Vec<u8>: RefUnwindSafe,
impl Send for UriMatcher
impl Sync for UriMatcher
impl Unpin for UriMatcher
impl UnsafeUnpin for UriMatcherwhere
*const ArcInner<RegexI> is !null: UnsafeUnpin,
PhantomData<ArcInner<RegexI>>: UnsafeUnpin,
*const Pool<Cache, Box<dyn Fn() -> Cache + UnwindSafe + RefUnwindSafe + Send + Sync>> is !null: UnsafeUnpin,
PhantomData<Pool<Cache, Box<dyn Fn() -> Cache + UnwindSafe + RefUnwindSafe + Send + Sync>>>: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
&'static [u8]: UnsafeUnpin,
Vec<u8>: UnsafeUnpin,
impl UnwindSafe for UriMatcherwhere
Arc<RegexI>: UnwindSafe,
BoxRaw<Pool<Cache, Box<dyn Fn() -> Cache + UnwindSafe + RefUnwindSafe + Send + Sync>>>: UnwindSafe,
Arc<str>: UnwindSafe,
&'static [u8]: UnwindSafe,
Vec<u8>: UnwindSafe,
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Create a new
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more