INNER CODE UNIT · Rust
new
qaul/qaul.net · rust/libp2p_modules/qaul_info/src/lib.rs:39
pub fn new(local_peer_id: PeerId) -> Self {
Self::from_config(QaulInfoConfig::new(local_peer_id))
}
/// Creates a `QaulInfo` with the given configuration.
pub fn from_config(config: QaulInfoConfig) -> Self {
QaulInfo {
events: VecDeque::new(),
config,
}
}
/// Send a QaulInfoMessage to a specific node
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