pub struct HandlerRegistry { /* private fields */ }Expand description
Registry of inventory-submitted subscription handlers.
Implementations§
Source§impl HandlerRegistry
impl HandlerRegistry
pub fn new() -> Self
pub fn auto_discover() -> Self
pub fn register(&mut self, item: &'static HandlerDescriptor)
Source§impl HandlerRegistry
impl HandlerRegistry
Sourcepub fn for_topic(&self, topic_name: &str) -> Vec<&'static HandlerDescriptor>
pub fn for_topic(&self, topic_name: &str) -> Vec<&'static HandlerDescriptor>
Handlers for a topic in stable registry-key order.
Methods from Deref<Target = Registry<HandlerDescriptor>>§
Sourcepub fn register(&mut self, item: &'static T)
pub fn register(&mut self, item: &'static T)
Insert a descriptor. If a descriptor with the same key already exists, it is replaced (last-write-wins).
Sourcepub fn get(&self, key: &str) -> Option<&'static T>
pub fn get(&self, key: &str) -> Option<&'static T>
Look up an item by registry key.
Sourcepub fn iter(&self) -> impl Iterator<Item = &'static T>
pub fn iter(&self) -> impl Iterator<Item = &'static T>
Iterates over all registered descriptors in arbitrary order.
Trait Implementations§
Source§impl Clone for HandlerRegistry
impl Clone for HandlerRegistry
Source§impl Debug for HandlerRegistry
impl Debug for HandlerRegistry
Source§impl Default for HandlerRegistry
impl Default for HandlerRegistry
Source§impl Deref for HandlerRegistry
impl Deref for HandlerRegistry
Auto Trait Implementations§
impl Freeze for HandlerRegistry
impl RefUnwindSafe for HandlerRegistry
impl Send for HandlerRegistry
impl Sync for HandlerRegistry
impl Unpin for HandlerRegistry
impl UnsafeUnpin for HandlerRegistry
impl UnwindSafe for HandlerRegistry
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