pub struct ObjectTemplate { /* private fields */ }Expand description
An object name built from the request: literal text with {path:N}
(the Nth path segment, from 1, percent-decoded), {query:name} and
{header:Name}. doc:{path:2} on /docs/42/edit is doc:42. Query
parameters and headers come from the client as sent — use a header only
when something in front (forward auth’s copy_header) sets it.
Implementations§
Source§impl ObjectTemplate
impl ObjectTemplate
pub fn parse(text: &str) -> Result<ObjectTemplate, String>
Sourcepub fn object_type(&self) -> Option<&str>
pub fn object_type(&self) -> Option<&str>
The literal type before the first :.
Sourcepub fn render(&self, request: &Request) -> Option<ObjectRef>
pub fn render(&self, request: &Request) -> Option<ObjectRef>
The object for request; None when a placeholder has no value or
the result isn’t a valid object name.
Path segments are percent-decoded once. A path with a . or ..
segment (raw or encoded), or a segment that decodes to something with
a /, names nothing: a proxy passes the path on as it came, and a
backend that resolves /docs/42/../7 would serve doc 7 after a check
on doc 42.
Trait Implementations§
Source§impl Clone for ObjectTemplate
impl Clone for ObjectTemplate
Source§fn clone(&self) -> ObjectTemplate
fn clone(&self) -> ObjectTemplate
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 moreSource§impl Debug for ObjectTemplate
impl Debug for ObjectTemplate
impl Eq for ObjectTemplate
Source§impl PartialEq for ObjectTemplate
impl PartialEq for ObjectTemplate
impl StructuralPartialEq for ObjectTemplate
Auto Trait Implementations§
impl Freeze for ObjectTemplate
impl RefUnwindSafe for ObjectTemplate
impl Send for ObjectTemplate
impl Sync for ObjectTemplate
impl Unpin for ObjectTemplate
impl UnsafeUnpin for ObjectTemplate
impl UnwindSafe for ObjectTemplate
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
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Available on crate feature
map-response-body only.Apply a transformation to the response body. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using gRPC headers. Read more