Skip to main content

BroadcastConfig

Struct BroadcastConfig 

Source
pub struct BroadcastConfig {
    pub outgoing_interval_s: Option<u64>,
    pub watch_incoming: bool,
    pub min_peer_interval_s: u64,
    pub peer_cleanup: PeerCleanupConfig,
}
Expand description

Identity-broadcast policy.

Broadcasts are routed PeerInfo control frames sent to every node in the local routing table — they let multi-hop peers learn each other’s node_id + x25519_pubkey without an out-of-band exchange.

Fields§

§outgoing_interval_s: Option<u64>

Cadence between scheduled outbound broadcast cycles, in seconds. None (or omitted) disables the periodic task; one-shot peers.broadcast_identity_now calls still work. Values below MIN_OUTGOING_INTERVAL_S are rejected at the RPC layer.

§watch_incoming: bool

When true, routed PeerInfo arrivals (the inbound side of a broadcast) are surfaced as peer_seen events and a discovered row in the UI. When false, the X25519 key is still cached (replies need it) but no event is emitted — useful on noisy meshes where the local node does not want surfaced discovery.

§min_peer_interval_s: u64

Minimum seconds that must elapse between accepted broadcasts from any single peer. Subsequent broadcasts from the same peer arriving sooner are dropped before the keystore is touched — a single misbehaving peer cannot flood the keystore or the UI.

§peer_cleanup: PeerCleanupConfig

Periodic cleanup of state.broadcast_peer_last_seen rate- limit entries — see PeerCleanupConfig. Ephemeral defaults (7 days / 1 h): the rate-limit map costs ~32 bytes per peer, so the horizon is generous; the goal is bounding worst-case growth on long-running nodes that see thousands of unique broadcasters.

Implementations§

Source§

impl BroadcastConfig

Source

pub const MIN_OUTGOING_INTERVAL_S: u64 = 30

Floor enforced by the RPC layer when a non-None outgoing_interval_s is supplied. Below this we’d start hammering the mesh.

Trait Implementations§

Source§

impl Clone for BroadcastConfig

Source§

fn clone(&self) -> BroadcastConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BroadcastConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BroadcastConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for BroadcastConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for BroadcastConfig

Source§

fn eq(&self, other: &BroadcastConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for BroadcastConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for BroadcastConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,