Struct UriTemplateMatcher
pub struct UriTemplateMatcher { /* private fields */ }net only.Expand description
Matches request paths and queries against a UriTemplate.
The path part becomes a PathPattern; it may hold only literals and
single-variable simple expressions ({name}), with names made of ASCII
letters, digits, _ and -. The query part may use {?a,b} / {&a,b}
expressions or literal name={var} pairs; literal name=value pairs are
required. Query pairs are matched by name in any order, unknown pairs are
ignored and repeated mapped names fail the match. Values are percent-decoded
once (RFC 3986, no form + handling). Requests whose path is not ASCII or
holds malformed percent-encoding never match.
PathPattern does all path matching, so a template path must also be a valid
route pattern; routes themselves use PathPattern syntax, not RFC 6570.
Implementations§
§impl UriTemplateMatcher
impl UriTemplateMatcher
pub fn try_new(
template: &UriTemplate,
) -> Result<UriTemplateMatcher, UriTemplateError>
pub fn try_new( template: &UriTemplate, ) -> Result<UriTemplateMatcher, UriTemplateError>
Build a matcher for template.
pub fn template(&self) -> &UriTemplate
pub fn template(&self) -> &UriTemplate
The template this matcher was built from.
Trait Implementations§
§impl Clone for UriTemplateMatcher
impl Clone for UriTemplateMatcher
§fn clone(&self) -> UriTemplateMatcher
fn clone(&self) -> UriTemplateMatcher
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Forget for UriTemplateMatcher
impl Freeze for UriTemplateMatcherwhere
*const ArcInner<Inner> is !null: Freeze,
PhantomData<ArcInner<Inner>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<PatternSegment>: Freeze,
PhantomData<u8>: Freeze,
*const TemplateVariable is !null: Freeze,
PhantomData<TemplateVariable>: Freeze,
*const str is !null: Freeze,
PhantomData<str>: Freeze,
*const (Box<str>, TemplateVariable) is !null: Freeze,
PhantomData<(Box<str>, TemplateVariable)>: Freeze,
*const (Box<str>, Option<Box<str>>) is !null: Freeze,
PhantomData<(Box<str>, Option<Box<str>>)>: Freeze,
impl Move for UriTemplateMatcher
impl RefUnwindSafe for UriTemplateMatcherwhere
Atomic<usize>: RefUnwindSafe,
TemplateVariable: RefUnwindSafe,
Element: RefUnwindSafe,
(Box<str>, TemplateVariable): RefUnwindSafe,
(Box<str>, Option<Box<str>>): RefUnwindSafe,
impl Send for UriTemplateMatcher
impl Sync for UriTemplateMatcherwhere
Arc<Inner>: Sync,
RawVecInner: Sync,
SmallVecData<[Element; 2]>: Sync,
Element: Sync,
SmallVecData<[TemplateVariable; 4]>: Sync,
TemplateVariable: Sync,
SmallVecData<[(Box<str>, TemplateVariable); 4]>: Sync,
(Box<str>, TemplateVariable): Sync,
SmallVecData<[(Box<str>, Option<Box<str>>); 2]>: Sync,
(Box<str>, Option<Box<str>>): Sync,
impl Unpin for UriTemplateMatcherwhere
Arc<Inner>: Unpin,
*const u8 is !null: Unpin,
Box<[u8]>: Unpin,
*const Element is !null: Unpin,
Element: Unpin,
*const TemplateVariable is !null: Unpin,
TemplateVariable: Unpin,
Box<str>: Unpin,
*const (Box<str>, TemplateVariable) is !null: Unpin,
(Box<str>, TemplateVariable): Unpin,
*const (Box<str>, Option<Box<str>>) is !null: Unpin,
(Box<str>, Option<Box<str>>): Unpin,
impl UnsafeUnpin for UriTemplateMatcherwhere
*const ArcInner<Inner> is !null: UnsafeUnpin,
PhantomData<ArcInner<Inner>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<PatternSegment>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const TemplateVariable is !null: UnsafeUnpin,
PhantomData<TemplateVariable>: UnsafeUnpin,
*const str is !null: UnsafeUnpin,
PhantomData<str>: UnsafeUnpin,
*const (Box<str>, TemplateVariable) is !null: UnsafeUnpin,
PhantomData<(Box<str>, TemplateVariable)>: UnsafeUnpin,
*const (Box<str>, Option<Box<str>>) is !null: UnsafeUnpin,
PhantomData<(Box<str>, Option<Box<str>>)>: UnsafeUnpin,
impl UnwindSafe for UriTemplateMatcherwhere
Arc<Inner>: UnwindSafe,
RawVecInner: UnwindSafe,
BoxRaw<[u8]>: UnwindSafe,
NonNull<Element>: UnwindSafe,
Element: UnwindSafe,
NonNull<TemplateVariable>: UnwindSafe,
TemplateVariable: UnwindSafe,
BoxRaw<str>: UnwindSafe,
NonNull<(Box<str>, TemplateVariable)>: UnwindSafe,
(Box<str>, TemplateVariable): UnwindSafe,
NonNull<(Box<str>, Option<Box<str>>)>: UnwindSafe,
(Box<str>, Option<Box<str>>): 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
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> ⓘ
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> ⓘ
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>
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>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more