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
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.