pub struct TemplateRegistry { /* private fields */ }Expand description
Thread-safe registry for route templates and their instantiated records.
The registry stores template specifications (RouteTemplateSpec) keyed by
their unique ID, and tracks TemplateInstanceRecord entries for each
template that has been instantiated at runtime.
Implementations§
Source§impl TemplateRegistry
impl TemplateRegistry
Sourcepub fn register(&self, spec: RouteTemplateSpec) -> Result<(), CamelError>
pub fn register(&self, spec: RouteTemplateSpec) -> Result<(), CamelError>
Register a route template specification.
Returns Err(CamelError) if a template with the same ID is already registered.
Sourcepub fn get(&self, id: &str) -> Option<RouteTemplateSpec>
pub fn get(&self, id: &str) -> Option<RouteTemplateSpec>
Retrieve a template specification by its ID.
Sourcepub fn template_ids(&self) -> Vec<String>
pub fn template_ids(&self) -> Vec<String>
Return all registered template IDs.
Sourcepub fn record_instance(&self, record: TemplateInstanceRecord)
pub fn record_instance(&self, record: TemplateInstanceRecord)
Record a newly instantiated template instance.
Sourcepub fn instances(&self, template_id: &str) -> Vec<TemplateInstanceRecord>
pub fn instances(&self, template_id: &str) -> Vec<TemplateInstanceRecord>
Return all instance records for a given template ID.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TemplateRegistry
impl RefUnwindSafe for TemplateRegistry
impl Send for TemplateRegistry
impl Sync for TemplateRegistry
impl Unpin for TemplateRegistry
impl UnsafeUnpin for TemplateRegistry
impl UnwindSafe for TemplateRegistry
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