pub struct ConnectOptions<'a> {
pub username: Option<&'a str>,
pub password: Option<&'a str>,
pub timeout: Option<Duration>,
pub reconnect: ReconnectBehavior,
pub tls_config: Option<Arc<ClientConfig>>,
}Fields§
§username: Option<&'a str>§password: Option<&'a str>§timeout: Option<Duration>§reconnect: ReconnectBehaviorWhether the returned client should reconnect automatically when the WebSocket
connection drops. Defaults to ReconnectBehavior::Enabled(ReconnectPolicy::default()) -
set this to ReconnectBehavior::Disabled to get the old one-shot-connection behavior.
tls_config: Option<Arc<ClientConfig>>Custom TLS trust config for wss:// addresses. None (the default) uses
tokio-tungstenite’s built-in rustls-tls-webpki-roots default, which only trusts
public CAs - it cannot validate a CSMS certificate issued by a private/internal CA.
Build a rustls::ClientConfig with a RootCertStore containing that CA’s certificate
(and optionally client-cert auth for mTLS) and set it here to connect to such a CSMS.
ocpp_client::rustls re-exports the exact rustls version this crate was built
against, so the ClientConfig you build is guaranteed compatible. Reconnect attempts
(see reconnect above) reuse the same config.
Trait Implementations§
Source§impl<'a> Clone for ConnectOptions<'a>
impl<'a> Clone for ConnectOptions<'a>
Source§fn clone(&self) -> ConnectOptions<'a>
fn clone(&self) -> ConnectOptions<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more