diff --git a/Cargo.toml b/Cargo.toml index 10b6c43..b807e4d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ members = [ resolver = "2" [workspace.package] -version = "0.2.0-alpha.1" +version = "0.2.0-alpha.2" edition = "2021" license = "MPL-2.0" repository = "https://github.com/al8n/memberlist" diff --git a/transports/net/src/options.rs b/transports/net/src/options.rs index 7573d77..ba32e84 100644 --- a/transports/net/src/options.rs +++ b/transports/net/src/options.rs @@ -325,6 +325,7 @@ pub struct NetTransportOptions>, } + impl, S: StreamLayer> Clone for NetTransportOptions where diff --git a/transports/quic/Cargo.toml b/transports/quic/Cargo.toml index dc39692..00c539f 100644 --- a/transports/quic/Cargo.toml +++ b/transports/quic/Cargo.toml @@ -83,7 +83,7 @@ rcgen = { version = "0.12", optional = true } # s2n s2n-quic = { version = "1.32", optional = true } -s2n-quic-transport = { version = "0.34", optional = true } +s2n-quic-transport = { version = "0.35", optional = true } # compression rayon = { version = "1.8", optional = true } diff --git a/transports/quic/src/options.rs b/transports/quic/src/options.rs index 04e0f6d..a6691f7 100644 --- a/transports/quic/src/options.rs +++ b/transports/quic/src/options.rs @@ -4,7 +4,7 @@ use super::*; /// Used to configure a net transport. #[viewit::viewit(getters(vis_all = "pub"), setters(vis_all = "pub", prefix = "with"))] -#[derive(Debug, Clone)] +#[derive(Debug)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr( feature = "serde", @@ -185,6 +185,34 @@ pub struct QuicTransportOptions>, } +impl, S: StreamLayer> Clone + for QuicTransportOptions +where + I: Clone, + A::Options: Clone, + S::Options: Clone, +{ + fn clone(&self) -> Self { + Self { + id: self.id.clone(), + bind_addresses: self.bind_addresses.clone(), + label: self.label.clone(), + resolver: self.resolver.clone(), + stream_layer: self.stream_layer.clone(), + skip_inbound_label_check: self.skip_inbound_label_check, + timeout: self.timeout, + connection_pool_cleanup_period: self.connection_pool_cleanup_period, + cidrs_policy: self.cidrs_policy.clone(), + #[cfg(feature = "compression")] + compressor: self.compressor, + #[cfg(feature = "compression")] + offload_size: self.offload_size, + #[cfg(feature = "metrics")] + metric_labels: self.metric_labels.clone(), + } + } +} + impl, S: StreamLayer> QuicTransportOptions where