photon_backend/
handler_registry.rs1#![allow(missing_docs)]
4
5use crate::handler_descriptor::HandlerDescriptor;
6
7quark::define_registry! {
8 pub struct HandlerRegistry for HandlerDescriptor;
10}
11
12impl HandlerRegistry {
13 #[must_use]
15 pub fn for_topic(&self, topic_name: &str) -> Vec<&'static HandlerDescriptor> {
16 let mut handlers: Vec<&'static HandlerDescriptor> = self
17 .iter()
18 .filter(|h| h.topic_name == topic_name)
19 .collect();
20 handlers.sort_by_key(|h| h.registry_key);
21 handlers
22 }
23}