pub struct QuicNetworkConfig {
pub timeout_ms: u64,
pub idle_timeout_ms: u64,
pub max_retries: u32,
pub use_tls: bool,
pub enable_nat_traversal: bool,
pub stun_servers: Vec<SocketAddr>,
pub enable_hole_punching: bool,
pub hole_punch_timeout_ms: u64,
pub ice_config: IceAgentConfig,
pub expected_parties: Option<usize>,
pub expected_clients: Option<usize>,
pub consensus_timeout_ms: u64,
}Expand description
Configuration for the QUIC network manager.
Controls connection timeouts, TLS settings, and NAT traversal options.
Fields§
§timeout_ms: u64Connection timeout in milliseconds
idle_timeout_ms: u64QUIC idle timeout in milliseconds. Connections with no activity for this duration will be closed. Set higher for MPC use cases with long pauses between computations. Default: 300,000ms (5 minutes).
max_retries: u32Maximum connection retry attempts
use_tls: boolEnable TLS encryption (should be true for production)
enable_nat_traversal: boolEnable NAT traversal features
stun_servers: Vec<SocketAddr>STUN servers for reflexive address discovery
enable_hole_punching: boolEnable hole punching for peer-to-peer connections
hole_punch_timeout_ms: u64Timeout for hole punching attempts (milliseconds)
ice_config: IceAgentConfigICE agent configuration
expected_parties: Option<usize>Expected number of parties (nodes). None = don’t gate on party count.
expected_clients: Option<usize>Expected number of clients. None = don’t gate on client count.
consensus_timeout_ms: u64Timeout for consensus protocol (ms). Default: 60_000.
Implementations§
Source§impl QuicNetworkConfig
impl QuicNetworkConfig
Sourcepub fn validate(&self) -> Result<(), QuicConfigError>
pub fn validate(&self) -> Result<(), QuicConfigError>
Sourcepub fn with_nat_traversal() -> QuicNetworkConfig
pub fn with_nat_traversal() -> QuicNetworkConfig
Creates a config with NAT traversal enabled
Sourcepub fn stun_servers(self, servers: Vec<SocketAddr>) -> QuicNetworkConfig
pub fn stun_servers(self, servers: Vec<SocketAddr>) -> QuicNetworkConfig
Sets custom STUN servers
Sourcepub fn nat_traversal(self, enabled: bool) -> QuicNetworkConfig
pub fn nat_traversal(self, enabled: bool) -> QuicNetworkConfig
Enables or disables NAT traversal
Trait Implementations§
Source§impl Clone for QuicNetworkConfig
impl Clone for QuicNetworkConfig
Source§fn clone(&self) -> QuicNetworkConfig
fn clone(&self) -> QuicNetworkConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QuicNetworkConfig
impl Debug for QuicNetworkConfig
Source§impl Default for QuicNetworkConfig
impl Default for QuicNetworkConfig
Source§fn default() -> QuicNetworkConfig
fn default() -> QuicNetworkConfig
Source§impl<'de> Deserialize<'de> for QuicNetworkConfig
impl<'de> Deserialize<'de> for QuicNetworkConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<QuicNetworkConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<QuicNetworkConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for QuicNetworkConfig
impl PartialEq for QuicNetworkConfig
Source§impl Serialize for QuicNetworkConfig
impl Serialize for QuicNetworkConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for QuicNetworkConfig
Source§impl TryFrom<&NetworkConfig> for QuicNetworkConfig
impl TryFrom<&NetworkConfig> for QuicNetworkConfig
Source§impl TryFrom<NetworkConfig> for QuicNetworkConfig
impl TryFrom<NetworkConfig> for QuicNetworkConfig
Auto Trait Implementations§
impl Freeze for QuicNetworkConfig
impl RefUnwindSafe for QuicNetworkConfig
impl Send for QuicNetworkConfig
impl Sync for QuicNetworkConfig
impl Unpin for QuicNetworkConfig
impl UnsafeUnpin for QuicNetworkConfig
impl UnwindSafe for QuicNetworkConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more