pub struct CompiledTemplateMatcher {
pub template: ResourceTemplate,
/* private fields */
}Expand description
Pre-compiled URI template matcher. Built once at initialization time so that
read_resource dispatch only runs the regex (no compilation overhead per request).
Created via CompiledTemplateMatcher::new and stored in a OnceLock by the
declare_resources! macro.
Fields§
§template: ResourceTemplateThe original template definition (metadata + handler).
Implementations§
Source§impl CompiledTemplateMatcher
impl CompiledTemplateMatcher
Sourcepub fn new(template: ResourceTemplate) -> Result<Self, String>
pub fn new(template: ResourceTemplate) -> Result<Self, String>
Compile a ResourceTemplate into a matcher.
Returns Err with a message if the URI template is syntactically invalid.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompiledTemplateMatcher
impl RefUnwindSafe for CompiledTemplateMatcher
impl Send for CompiledTemplateMatcher
impl Sync for CompiledTemplateMatcher
impl Unpin for CompiledTemplateMatcher
impl UnsafeUnpin for CompiledTemplateMatcher
impl UnwindSafe for CompiledTemplateMatcher
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