pub struct ExtensionSlots<C, EV, DE> {
pub command_interceptors: Vec<CommandInterceptor<C, DE>>,
pub event_listeners: Vec<EventListener<EV>>,
pub command_taps: Vec<UnboundedSender<C>>,
pub event_taps: Vec<UnboundedSender<EV>>,
}Expand description
Bundle of extension hooks. Reused by every pattern that wants to let users plug in their own actors / sinks at well-known points.
Fields§
§command_interceptors: Vec<CommandInterceptor<C, DE>>§event_listeners: Vec<EventListener<EV>>§command_taps: Vec<UnboundedSender<C>>§event_taps: Vec<UnboundedSender<EV>>Implementations§
Source§impl<C, EV, DE> ExtensionSlots<C, EV, DE>
impl<C, EV, DE> ExtensionSlots<C, EV, DE>
Sourcepub fn run_interceptors(&self, cmd: &C) -> Result<(), PatternError<DE>>
pub fn run_interceptors(&self, cmd: &C) -> Result<(), PatternError<DE>>
Run every interceptor; bail on the first rejection.
Sourcepub fn notify_listeners(&self, ev: &EV)
pub fn notify_listeners(&self, ev: &EV)
Notify every event listener.
Source§impl<C: Clone, EV, DE> ExtensionSlots<C, EV, DE>
impl<C: Clone, EV, DE> ExtensionSlots<C, EV, DE>
Sourcepub fn push_command_taps(&mut self, cmd: &C)
pub fn push_command_taps(&mut self, cmd: &C)
Push a command clone to every command tap. Closed receivers are silently pruned.
Source§impl<C, EV: Clone, DE> ExtensionSlots<C, EV, DE>
impl<C, EV: Clone, DE> ExtensionSlots<C, EV, DE>
Sourcepub fn push_event_taps(&mut self, ev: &EV)
pub fn push_event_taps(&mut self, ev: &EV)
Push an event clone to every event tap. Closed receivers are silently pruned.
Trait Implementations§
Source§impl<C, EV, DE> Clone for ExtensionSlots<C, EV, DE>
impl<C, EV, DE> Clone for ExtensionSlots<C, EV, DE>
Auto Trait Implementations§
impl<C, EV, DE> Freeze for ExtensionSlots<C, EV, DE>
impl<C, EV, DE> !RefUnwindSafe for ExtensionSlots<C, EV, DE>
impl<C, EV, DE> Send for ExtensionSlots<C, EV, DE>
impl<C, EV, DE> Sync for ExtensionSlots<C, EV, DE>
impl<C, EV, DE> Unpin for ExtensionSlots<C, EV, DE>
impl<C, EV, DE> UnsafeUnpin for ExtensionSlots<C, EV, DE>
impl<C, EV, DE> !UnwindSafe for ExtensionSlots<C, EV, DE>
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