pub struct PeerCleanupConfig {
pub enabled: bool,
pub max_unreachable_lifetime_s: u64,
pub cleanup_interval_s: u64,
}Expand description
Shared shape of every peer-cleanup subsection. Parent configs
embed an instance and provide their own Default so the
horizon and cadence are tuned to the kind of peer being tracked.
Fields§
§enabled: boolEnable the periodic cleanup task for this owner. When false
no destructive action is taken regardless of the other
fields.
max_unreachable_lifetime_s: u64Threshold past which a peer is considered unreachable and
eligible for the destructive cleanup action. Daemon clamps
values below MIN_LIFETIME_S (1 hour) at runtime.
cleanup_interval_s: u64Interval between cleanup sweeps. Daemon clamps values below
MIN_INTERVAL_S (60 seconds) at runtime.
Implementations§
Source§impl PeerCleanupConfig
impl PeerCleanupConfig
Sourcepub fn bluetooth_default() -> Self
pub fn bluetooth_default() -> Self
Bluetooth-flavoured default: cleanup ON with a 2 h horizon and 1 h sweep. Tuned for paired BT devices that come and go on daily timescales.
Sourcepub fn mesh_identity_default() -> Self
pub fn mesh_identity_default() -> Self
Mesh-identity default: cleanup ON with a 90 day horizon and
daily sweep. Identity rows are cheap to recreate on next
contact (one extra handshake), so ageing them out after a
season is fine and prevents peers_seen from growing
indefinitely on long-running nodes.
Sourcepub fn ephemeral_default() -> Self
pub fn ephemeral_default() -> Self
In-memory rate-limit / discovery state default: cleanup ON with a 7 day horizon and 1 h sweep. The map keys cost effectively nothing per entry, but a long-running broadcaster shouldn’t accumulate entries for peers seen weeks ago.
Trait Implementations§
Source§impl Clone for PeerCleanupConfig
impl Clone for PeerCleanupConfig
Source§fn clone(&self) -> PeerCleanupConfig
fn clone(&self) -> PeerCleanupConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PeerCleanupConfig
impl Debug for PeerCleanupConfig
Source§impl<'de> Deserialize<'de> for PeerCleanupConfig
impl<'de> Deserialize<'de> for PeerCleanupConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for PeerCleanupConfig
impl PartialEq for PeerCleanupConfig
Source§fn eq(&self, other: &PeerCleanupConfig) -> bool
fn eq(&self, other: &PeerCleanupConfig) -> bool
self and other values to be equal, and is used by ==.