INNER CODE UNIT · Rust
send_qaul_info_message
qaul/qaul.net · rust/libp2p_modules/qaul_info/src/lib.rs:52
pub fn send_qaul_info_message(&mut self, node_id: PeerId, data: Vec<u8>) {
// create event message
let message = QaulInfoData { data };
// Schedule message for sending
self.events.push_back(ToSwarm::NotifyHandler {
peer_id: node_id,
handler: NotifyHandler::Any,
event: message,
});
}
}
impl NetworkBehaviour for QaulInfo {
type ConnectionHandler = OneShotHandler<QaulInfoProtocol, QaulInfoData, InnerMessage>;
type ToSwarm = QaulInfoEvent;
fn poll(&mut self, _: &mut Context<'_>) -> Poll<ToSwarm<Self::ToSwarm, QaulInfoData>> {