pub struct PeerConfig {
pub initial_reconnect_delay: Duration,
pub max_reconnect_delay: Duration,
pub max_queue_size: usize,
pub connection_timeout: Duration,
pub max_connection_failures: Option<u32>,
}Expand description
Configuration for peer behavior and reconnection parameters.
Fields§
§initial_reconnect_delay: DurationInitial delay before attempting reconnection
max_reconnect_delay: DurationMaximum delay between reconnection attempts
max_queue_size: usizeMaximum number of messages to queue when disconnected
connection_timeout: DurationTimeout for connection attempts
max_connection_failures: Option<u32>Maximum number of consecutive connection failures before giving up None means unlimited retries
Implementations§
Source§impl PeerConfig
impl PeerConfig
Sourcepub fn new(
max_queue_size: usize,
connection_timeout: Duration,
initial_reconnect_delay: Duration,
max_reconnect_delay: Duration,
max_connection_failures: Option<u32>,
) -> PeerConfig
pub fn new( max_queue_size: usize, connection_timeout: Duration, initial_reconnect_delay: Duration, max_reconnect_delay: Duration, max_connection_failures: Option<u32>, ) -> PeerConfig
Create a new configuration with specified parameters.
Sourcepub fn local_network() -> PeerConfig
pub fn local_network() -> PeerConfig
Create a configuration for low-latency local networking.
Sourcepub fn wan_network() -> PeerConfig
pub fn wan_network() -> PeerConfig
Create a configuration for high-latency WAN networking.
Trait Implementations§
Source§impl Clone for PeerConfig
impl Clone for PeerConfig
Source§fn clone(&self) -> PeerConfig
fn clone(&self) -> PeerConfig
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 PeerConfig
impl Debug for PeerConfig
Source§impl Default for PeerConfig
impl Default for PeerConfig
Source§fn default() -> PeerConfig
fn default() -> PeerConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PeerConfig
impl RefUnwindSafe for PeerConfig
impl Send for PeerConfig
impl Sync for PeerConfig
impl Unpin for PeerConfig
impl UnwindSafe for PeerConfig
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)