pub struct NoOpEventBus;Expand description
A non-generic, type-erased no-op event bus.
Unlike NoOpPublisher<E>, this single struct can publish any event type
without being parameterized. Use it in contexts where a concrete bus
instance is required but no event forwarding is desired.
This eliminates the Option<event_bus> anti-pattern in services — a service
can always hold an Arc<NoOpEventBus> and call publish() unconditionally.
§Example
ⓘ
use backbone_messaging::NoOpEventBus;
let bus = NoOpEventBus::new();
bus.publish(my_event).await?; // silently discardedImplementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NoOpEventBus
impl RefUnwindSafe for NoOpEventBus
impl Send for NoOpEventBus
impl Sync for NoOpEventBus
impl Unpin for NoOpEventBus
impl UnsafeUnpin for NoOpEventBus
impl UnwindSafe for NoOpEventBus
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