karyon_p2p

Struct Config

Source
pub struct Config {
Show 22 fields pub version: Version, pub enable_monitor: bool, pub handshake_timeout: u64, pub ping_interval: u64, pub ping_timeout: u64, pub max_connect_retries: usize, pub bootstrap_peers: Vec<Endpoint>, pub listen_endpoint: Option<Endpoint>, pub peer_endpoints: Vec<Endpoint>, pub inbound_slots: usize, pub outbound_slots: usize, pub discovery_port: Port, pub seeding_interval: u64, pub lookup_inbound_slots: usize, pub lookup_outbound_slots: usize, pub lookup_response_timeout: u64, pub lookup_connection_lifespan: u64, pub lookup_connect_retries: usize, pub refresh_interval: u64, pub refresh_response_timeout: u64, pub refresh_connect_retries: usize, pub enable_tls: bool,
}
Expand description

the Configuration for the P2P network.

Fields§

§version: Version

Represents the network version.

§enable_monitor: bool

Enable monitor

§handshake_timeout: u64

Timeout duration for the handshake with new peers, in seconds.

§ping_interval: u64

Interval at which the ping protocol sends ping messages to a peer to maintain connections, in seconds.

§ping_timeout: u64

Timeout duration for receiving the pong message corresponding to the sent ping message, in seconds.

§max_connect_retries: usize

The maximum number of retries for outbound connection establishment.

§bootstrap_peers: Vec<Endpoint>

A list of bootstrap peers for the seeding process.

§listen_endpoint: Option<Endpoint>

An optional listening endpoint to accept incoming connections.

§peer_endpoints: Vec<Endpoint>

A list of endpoints representing peers that the Discovery will manually connect to.

§inbound_slots: usize

The number of available inbound slots for incoming connections.

§outbound_slots: usize

The number of available outbound slots for outgoing connections.

§discovery_port: Port

TCP/UDP port for lookup and refresh processes.

§seeding_interval: u64

Time interval, in seconds, at which the Discovery restarts the seeding process.

§lookup_inbound_slots: usize

The number of available inbound slots for incoming connections during the lookup process.

§lookup_outbound_slots: usize

The number of available outbound slots for outgoing connections during the lookup process.

§lookup_response_timeout: u64

Timeout duration for a peer response during the lookup process, in seconds.

§lookup_connection_lifespan: u64

Maximum allowable time for a live connection with a peer during the lookup process, in seconds.

§lookup_connect_retries: usize

The maximum number of retries for outbound connection establishment during the lookup process.

§refresh_interval: u64

Interval at which the table refreshes its entries, in seconds.

§refresh_response_timeout: u64

Timeout duration for a peer response during the table refresh process, in seconds.

§refresh_connect_retries: usize

The maximum number of retries for outbound connection establishment during the refresh process.

§enable_tls: bool

Enables TLS for all connections.

Trait Implementations§

Source§

impl Default for Config

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

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
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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