Trait malus::interceptor::MessageInterceptor
source · pub trait MessageInterceptor<Sender>: Send + Sync + Clone + 'staticwhere
Sender: SubsystemSender<<Self::Message as AssociateOutgoing>::OutgoingMessages> + Clone + 'static,{
type Message: AssociateOutgoing + Send + 'static;
// Provided methods
fn intercept_incoming(
&self,
_sender: &mut Sender,
msg: FromOrchestra<Self::Message>,
) -> Option<FromOrchestra<Self::Message>> { ... }
fn need_intercept_outgoing(
&self,
_msg: &<Self::Message as AssociateOutgoing>::OutgoingMessages,
) -> bool { ... }
fn intercept_outgoing(
&self,
_msg: &<Self::Message as AssociateOutgoing>::OutgoingMessages,
) -> Option<<Self::Message as AssociateOutgoing>::OutgoingMessages> { ... }
}
Expand description
Filter incoming and outgoing messages.
Required Associated Types§
Provided Methods§
sourcefn intercept_incoming(
&self,
_sender: &mut Sender,
msg: FromOrchestra<Self::Message>,
) -> Option<FromOrchestra<Self::Message>>
fn intercept_incoming( &self, _sender: &mut Sender, msg: FromOrchestra<Self::Message>, ) -> Option<FromOrchestra<Self::Message>>
Filter messages that are to be received by the subsystem.
For non-trivial cases, the sender
can be used to send
multiple messages after doing some additional processing.
sourcefn need_intercept_outgoing(
&self,
_msg: &<Self::Message as AssociateOutgoing>::OutgoingMessages,
) -> bool
fn need_intercept_outgoing( &self, _msg: &<Self::Message as AssociateOutgoing>::OutgoingMessages, ) -> bool
Specifies if we need to replace some outgoing message with another (potentially empty) message
sourcefn intercept_outgoing(
&self,
_msg: &<Self::Message as AssociateOutgoing>::OutgoingMessages,
) -> Option<<Self::Message as AssociateOutgoing>::OutgoingMessages>
fn intercept_outgoing( &self, _msg: &<Self::Message as AssociateOutgoing>::OutgoingMessages, ) -> Option<<Self::Message as AssociateOutgoing>::OutgoingMessages>
Send modified message instead of the original one
Object Safety§
This trait is not object safe.