pub struct DhtConfig {
pub replication_factor: u8,
pub alpha: u8,
pub beta: u8,
pub record_ttl: u64,
pub adaptive_routing: bool,
pub trust_selection_enabled: bool,
pub trust_weight: f64,
pub min_trust_threshold: f64,
pub exclude_untrusted_for_storage: bool,
}Expand description
DHT configuration
Fields§
§replication_factor: u8Replication factor (K value)
alpha: u8Alpha value for parallel queries
beta: u8Beta value for routing
record_ttl: u64Record TTL in seconds
adaptive_routing: boolEnable adaptive routing
trust_selection_enabled: boolEnable trust-weighted peer selection When enabled, peer selection combines XOR distance with EigenTrust scores
trust_weight: f64Weight given to trust in peer selection (0.0-1.0) Higher values = prefer trusted nodes over closer nodes Default: 0.3 (30% weight to trust factor)
min_trust_threshold: f64Minimum trust threshold for peer selection Nodes below this trust score are deprioritized Default: 0.1
exclude_untrusted_for_storage: boolExclude untrusted nodes from storage operations When true, nodes below min_trust_threshold are excluded from storage targets Default: false
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DhtConfig
impl<'de> Deserialize<'de> for DhtConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DhtConfig
impl RefUnwindSafe for DhtConfig
impl Send for DhtConfig
impl Sync for DhtConfig
impl Unpin for DhtConfig
impl UnwindSafe for DhtConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more