pub struct HandlerRegistry { /* private fields */ }Expand description
Registry of inventory-submitted subscription handlers.
Implementations§
Source§impl HandlerRegistry
impl HandlerRegistry
pub fn new() -> HandlerRegistry
pub fn auto_discover() -> HandlerRegistry
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§fn clone(&self) -> HandlerRegistry
fn clone(&self) -> HandlerRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HandlerRegistry
impl Debug for HandlerRegistry
Source§impl Default for HandlerRegistry
impl Default for HandlerRegistry
Source§fn default() -> HandlerRegistry
fn default() -> HandlerRegistry
Returns the “default value” for a type. Read more
Source§impl Deref for HandlerRegistry
impl Deref for HandlerRegistry
Source§impl DerefMut for HandlerRegistry
impl DerefMut 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