pub trait ResponsiveMessages<LocalPeerMessages: ResponsiveMessages<LocalPeerMessages> + Send + PartialEq + Debug> {
// Required methods
fn is_disconnect_message(processor_answer: &LocalPeerMessages) -> bool;
fn is_no_answer_message(processor_answer: &LocalPeerMessages) -> bool;
}
Expand description
Adherents will, typically, also implement [ReactiveMessagingUnresponsiveSerializer].
By upgrading your type with this trait, it is possible to build a “Responsive Processor”, where the returned Stream
contains the messages to be sent as an answer to the remote peer.
This trait, therefore, specifies (to the internal sender) how to handle special response cases, like “no answer” and “disconnection” messages.
Required Methods§
sourcefn is_disconnect_message(processor_answer: &LocalPeerMessages) -> bool
fn is_disconnect_message(processor_answer: &LocalPeerMessages) -> bool
Informs the internal sender if the given processor_answer
is a “disconnect” message & command (issued by the messages processor logic)
– in which case, the network processor will send it and, immediately, close the connection.
IMPLEMENTORS: #[inline(always)]
sourcefn is_no_answer_message(processor_answer: &LocalPeerMessages) -> bool
fn is_no_answer_message(processor_answer: &LocalPeerMessages) -> bool
Tells if internal sender if the given processor_answer
represents a “no message” – a message that should produce no answer to the peer.
IMPLEMENTORS: #[inline(always)]
Implementations on Foreign Types§
source§impl ResponsiveMessages<String> for String
impl ResponsiveMessages<String> for String
Our test text-only protocol’s messages may also be used by “Responsive Processors”