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§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
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§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.