pub struct ListenerRegistry { /* private fields */ }Implementations§
Source§impl ListenerRegistry
impl ListenerRegistry
Sourcepub fn on<E, F, Fut>(self, listener: F) -> Self
pub fn on<E, F, Fut>(self, listener: F) -> Self
Registers listener to run whenever an E is dispatched. Multiple
listeners for the same E (including across separate .on::<E>()
calls) all run, in the order they were registered.
Sourcepub fn publish(self)
pub fn publish(self)
Publishes this registry process-wide - dispatch() reads from it
afterward. Same “second call warns, doesn’t panic, first writer
wins” shape as larust_http::route::publish_route_names: a second
.publish() in the same process (e.g. Application::new()-style
re-entry in tests) doesn’t overwrite the first registry, and every
dispatch() afterward keeps using it.
Auto Trait Implementations§
impl !RefUnwindSafe for ListenerRegistry
impl !UnwindSafe for ListenerRegistry
impl Forget for ListenerRegistry
impl Freeze for ListenerRegistry
impl Move for ListenerRegistry
impl Send for ListenerRegistry
impl Sync for ListenerRegistry
impl Unpin for ListenerRegistry
impl UnsafeUnpin for ListenerRegistry
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