pub struct CompiledUriTemplate<'a> { /* private fields */ }Expand description
Pre-compiled representation of a URI template pattern.
Parses {variable} placeholders once at registration time so that
matches and extract_borrowed
run in pure stack memory without re-scanning the template string or
allocating heap Strings.
Implementations§
Source§impl<'a> CompiledUriTemplate<'a>
impl<'a> CompiledUriTemplate<'a>
Sourcepub fn new(template: &'a str) -> Self
pub fn new(template: &'a str) -> Self
Compile a URI template string into its constituent segments.
Sourcepub fn segments(&self) -> &[TemplateSegment<'a>]
pub fn segments(&self) -> &[TemplateSegment<'a>]
Return the parsed template segments.
Sourcepub const fn var_count(&self) -> usize
pub const fn var_count(&self) -> usize
Return the number of placeholder variables in this template.
Trait Implementations§
Source§impl<'a> Clone for CompiledUriTemplate<'a>
impl<'a> Clone for CompiledUriTemplate<'a>
Source§impl<'a> Debug for CompiledUriTemplate<'a>
impl<'a> Debug for CompiledUriTemplate<'a>
impl<'a> Eq for CompiledUriTemplate<'a>
Source§impl<'a> PartialEq for CompiledUriTemplate<'a>
impl<'a> PartialEq for CompiledUriTemplate<'a>
impl<'a> StructuralPartialEq for CompiledUriTemplate<'a>
Auto Trait Implementations§
impl<'a> Freeze for CompiledUriTemplate<'a>
impl<'a> RefUnwindSafe for CompiledUriTemplate<'a>
impl<'a> Send for CompiledUriTemplate<'a>
impl<'a> Sync for CompiledUriTemplate<'a>
impl<'a> Unpin for CompiledUriTemplate<'a>
impl<'a> UnsafeUnpin for CompiledUriTemplate<'a>
impl<'a> UnwindSafe for CompiledUriTemplate<'a>
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.