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> =
17 self.iter().filter(|h| h.topic_name == topic_name).collect();
18 handlers.sort_by_key(|h| h.registry_key);
19 handlers
20 }
21}