From e1c0e90581b7ce97f87ddf43267ceb32e28447e3 Mon Sep 17 00:00:00 2001 From: Daniel López Azaña Date: Thu, 28 Mar 2024 19:19:46 +0100 Subject: ✨ (client_listener.rs): Implement Debug trait for ClientListener for better logging ♻️ (connection_details.rs): Refactor ConnectionDetails to use Option for optional fields ♻️ (connection_details.rs): Change new constructor to accept &str and convert to String ✨ (connection_details.rs): Implement Debug trait for ConnectionDetails ♻️ (connection_options.rs): Implement Debug trait for ConnectionOptions ♻️ (lightstreamer_client.rs): Refactor LightstreamerClient to use Option for server_address and adapter_set ✨ (lightstreamer_client.rs): Implement Debug trait for LightstreamerClient ♻️ (main.rs): Update subscribe_to_channel function to use new control.txt URL and parameters ♻️ (main.rs): Update main function to use Option<&str> when creating LightstreamerClient ✨ (proxy.rs): Add Proxy struct and ProxyType enum to handle proxy configurations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/connection_options.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/connection_options.rs') diff --git a/src/connection_options.rs b/src/connection_options.rs index aefb0c0..cbe45b5 100644 --- a/src/connection_options.rs +++ b/src/connection_options.rs @@ -1,5 +1,7 @@ use crate::proxy::Proxy; +use std::fmt::{self, Debug, Formatter}; + /// Used by LightstreamerClient to provide an extra connection properties data object. /// Data struct that contains the policy settings used to connect to a Lightstreamer Server. /// An instance of this struct is attached to every LightstreamerClient as connection_options. @@ -121,6 +123,31 @@ impl ConnectionOptions { } } +impl Debug for ConnectionOptions { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("ConnectionOptions") + .field("content_length", &self.content_length) + .field("first_retry_max_delay", &self.first_retry_max_delay) + .field("forced_transport", &self.forced_transport) + .field("http_extra_headers", &self.http_extra_headers) + .field("http_extra_headers_on_session_creation_only", &self.http_extra_headers_on_session_creation_only) + .field("idle_timeout", &self.idle_timeout) + .field("keepalive_interval", &self.keepalive_interval) + .field("polling_interval", &self.polling_interval) + .field("proxy", &self.proxy) + .field("real_max_bandwidth", &self.real_max_bandwidth) + .field("reconnect_timeout", &self.reconnect_timeout) + .field("requested_max_bandwidth", &self.requested_max_bandwidth) + .field("retry_delay", &self.retry_delay) + .field("reverse_heartbeat_interval", &self.reverse_heartbeat_interval) + .field("server_instance_address_ignored", &self.server_instance_address_ignored) + .field("session_recovery_timeout", &self.session_recovery_timeout) + .field("slowing_enabled", &self.slowing_enabled) + .field("stalled_timeout", &self.stalled_timeout) + .finish() + } +} + impl Default for ConnectionOptions { fn default() -> Self { ConnectionOptions { -- cgit v1.2.3