mod.rs

Overview

The mod.rs file functions as a central module aggregator and re-exporter within its directory. It groups together two submodules, node and watch, and publicly exposes selected structs and functions from those submodules for external use. This modular approach encapsulates functionality related to gossip protocol nodes and gossip event watching mechanisms, facilitating clean and organized access to these components.

Modules

node

This submodule is responsible for the core gossip node implementation. It defines the behavior and data structures necessary to interact with gossip network peers and to sign gossip messages.

watch

The watch submodule provides functionality to observe or subscribe to gossip events or state changes, potentially with configurable subscription strategies.

Public API

The file publicly exposes the following items from its submodules:

Exported Item

Source Module

Description

sign_gossip_node

node

Function to sign gossip messages/nodes for security purposes.

GossipPeer

node

Represents a peer node in the gossip network.

watch_gossip

watch

Function to start watching gossip events.

SubscribeStrategy

watch

Strategy options for subscribing to gossip event streams.

WatchGossipConfig

watch

Configuration settings for the gossip watcher.

Interaction with Other Components

Implementation Details

Mermaid Diagram

flowchart TD
mod_rs["mod.rs"]
node["node"]
watch["watch"]
mod_rs -->|pub use| sign_gossip_node["sign_gossip_node()"]
mod_rs -->|pub use| GossipPeer["GossipPeer"]
mod_rs -->|pub use| watch_gossip["watch_gossip()"]
mod_rs -->|pub use| SubscribeStrategy["SubscribeStrategy"]
mod_rs -->|pub use| WatchGossipConfig["WatchGossipConfig"]
node --> sign_gossip_node
node --> GossipPeer
watch --> watch_gossip
watch --> SubscribeStrategy
watch --> WatchGossipConfig