pub struct P2pConfigBuilder { /* private fields */ }Expand description
Builder for P2pConfig
Implementations§
Source§impl P2pConfigBuilder
impl P2pConfigBuilder
Sourcepub fn bind_addr(self, addr: SocketAddr) -> Self
pub fn bind_addr(self, addr: SocketAddr) -> Self
Set the bind address
Sourcepub fn known_peer(self, addr: SocketAddr) -> Self
pub fn known_peer(self, addr: SocketAddr) -> Self
Add a known peer for initial discovery In v0.13.0+ all nodes are symmetric - these are just starting points
Sourcepub fn known_peers(self, addrs: impl IntoIterator<Item = SocketAddr>) -> Self
pub fn known_peers(self, addrs: impl IntoIterator<Item = SocketAddr>) -> Self
Add multiple known peers
Sourcepub fn max_connections(self, max: usize) -> Self
pub fn max_connections(self, max: usize) -> Self
Set maximum connections
Sourcepub fn auth(self, auth: AuthConfig) -> Self
pub fn auth(self, auth: AuthConfig) -> Self
Set authentication configuration
Sourcepub fn timeouts(self, timeouts: TimeoutConfig) -> Self
pub fn timeouts(self, timeouts: TimeoutConfig) -> Self
Set timeout configuration
Sourcepub fn fast_timeouts(self) -> Self
pub fn fast_timeouts(self) -> Self
Use fast timeouts (for local networks)
Sourcepub fn conservative_timeouts(self) -> Self
pub fn conservative_timeouts(self) -> Self
Use conservative timeouts (for unreliable networks)
Sourcepub fn pqc_optimized_mtu(self) -> Self
pub fn pqc_optimized_mtu(self) -> Self
Use PQC-optimized MTU settings
Enables larger MTU bounds (up to 4096) for efficient PQC handshakes.
Sourcepub fn constrained_mtu(self) -> Self
pub fn constrained_mtu(self) -> Self
Use constrained network MTU settings
Disables MTU discovery and uses minimum MTU (1200).
Sourcepub fn jumbo_mtu(self) -> Self
pub fn jumbo_mtu(self) -> Self
Use jumbo frame MTU settings
For high-bandwidth networks supporting larger frames (up to 9000).
Sourcepub fn stats_interval(self, interval: Duration) -> Self
pub fn stats_interval(self, interval: Duration) -> Self
Set statistics collection interval
Sourcepub fn build(self) -> Result<P2pConfig, ConfigError>
pub fn build(self) -> Result<P2pConfig, ConfigError>
Build the configuration with validation
Trait Implementations§
Source§impl Clone for P2pConfigBuilder
impl Clone for P2pConfigBuilder
Source§fn clone(&self) -> P2pConfigBuilder
fn clone(&self) -> P2pConfigBuilder
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for P2pConfigBuilder
impl Debug for P2pConfigBuilder
Source§impl Default for P2pConfigBuilder
impl Default for P2pConfigBuilder
Source§fn default() -> P2pConfigBuilder
fn default() -> P2pConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for P2pConfigBuilder
impl RefUnwindSafe for P2pConfigBuilder
impl Send for P2pConfigBuilder
impl Sync for P2pConfigBuilder
impl Unpin for P2pConfigBuilder
impl UnwindSafe for P2pConfigBuilder
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)