pub struct NodeOptions {
    pub value_ttl_sec: u32,
    pub query_timeout_ms: u64,
    pub default_value_batch_len: usize,
    pub bad_peer_threshold: usize,
    pub max_allowed_k: u32,
    pub max_key_name_len: usize,
    pub max_key_index: u32,
    pub storage_gc_interval_ms: u64,
}
Expand description

DHT node configuration

Fields

value_ttl_sec: u32

Default stored value timeout used for Node::store_overlay_node and Node::store_ip_address

Default: 3600 seconds

query_timeout_ms: u64

ADNL query timeout

Default: 1000 ms

default_value_batch_len: usize

Amount of DHT peers, used for values search

Default: 5

bad_peer_threshold: usize

Max peer penalty points. On each unsuccessful query every peer gains 2 points, and then they are reduced by one on each good action.

Default: 5

max_allowed_k: u32

Max allowed k value for DHT FindValue query.

Default: 5

max_key_name_len: usize

Max allowed key name length (in bytes).

See proto::dht::Key

Default: 127 bytes

max_key_index: u32

Max allowed key index

See proto::dht::Key

Default: 15

storage_gc_interval_ms: u64

Storage GC interval. Will remove all outdated entries

Default: 10000 ms

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Extract a subset of the possible types in a coproduct (or get the remaining possibilities) Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Performs the indexed conversion.

Should always be Self

Consumes the current HList and returns an HList with the requested shape. Read more

The resulting type after obtaining ownership.

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more