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 UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.