referrerpolicy=no-referrer-when-downgrade

Trait malus::interceptor::MessageInterceptor

source ·
pub trait MessageInterceptor<Sender>: Send + Sync + Clone + 'static
where 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§

source

type Message: AssociateOutgoing + Send + 'static

The message type the original subsystem handles incoming.

Provided Methods§

source

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.

source

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

source

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.

Implementors§

source§

impl<Sender> MessageInterceptor<Sender> for ReplaceValidationResult
where Sender: CandidateValidationSenderTrait + Clone + Send + 'static,

source§

impl<Sender> MessageInterceptor<Sender> for RequestSpammer
where Sender: NetworkBridgeTxSenderTrait + Clone + Send + 'static,

source§

impl<Sender> MessageInterceptor<Sender> for IgnoreDisabled
where Sender: RuntimeApiSenderTrait + Clone + Send + 'static,

source§

impl<Sender, Spawner> MessageInterceptor<Sender> for AncestorDisputer<Spawner>
where Sender: ApprovalVotingSenderTrait + Clone + Send + 'static, Spawner: Spawner + Clone + 'static,

source§

impl<Sender, Spawner> MessageInterceptor<Sender> for NoteCandidate<Spawner>
where Sender: CandidateBackingSenderTrait + Clone + Send + 'static, Spawner: Spawner + Clone + 'static,