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 UriTemplateMatcher
impl Move for UriTemplateMatcher
impl RefUnwindSafe for UriTemplateMatcher
impl Send for UriTemplateMatcher
impl Sync for UriTemplateMatcher
impl Unpin for UriTemplateMatcher
impl UnsafeUnpin for UriTemplateMatcher
impl UnwindSafe for UriTemplateMatcher
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