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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more