pub struct NtripConfig {
pub host: String,
pub port: u16,
pub mountpoint: String,
pub username: Option<String>,
pub password: Option<String>,
pub use_tls: bool,
pub tls_skip_verify: bool,
pub ntrip_version: NtripVersion,
pub connection: ConnectionConfig,
pub proxy: Option<ProxyConfig>,
}Expand description
Configuration for an NTRIP client connection.
Fields§
§host: StringCaster hostname or IP address.
port: u16Caster port (typically 2101).
mountpoint: StringMountpoint name.
username: Option<String>Username for authentication.
password: Option<String>Password for authentication.
use_tls: boolUse HTTPS/TLS.
tls_skip_verify: boolSkip TLS certificate verification (insecure, for testing only).
ntrip_version: NtripVersionNTRIP protocol version.
connection: ConnectionConfigConnection configuration.
proxy: Option<ProxyConfig>HTTP proxy configuration (optional).
Implementations§
Source§impl NtripConfig
impl NtripConfig
Sourcepub fn new(
host: impl Into<String>,
port: u16,
mountpoint: impl Into<String>,
) -> Self
pub fn new( host: impl Into<String>, port: u16, mountpoint: impl Into<String>, ) -> Self
Create a new configuration with required fields.
Sourcepub fn with_credentials(
self,
username: impl Into<String>,
password: impl Into<String>,
) -> Self
pub fn with_credentials( self, username: impl Into<String>, password: impl Into<String>, ) -> Self
Set credentials for authentication.
Sourcepub fn with_tls_skip_verify(self) -> Self
pub fn with_tls_skip_verify(self) -> Self
Skip TLS certificate verification (insecure).
Sourcepub fn with_version(self, version: NtripVersion) -> Self
pub fn with_version(self, version: NtripVersion) -> Self
Set NTRIP protocol version.
Sourcepub fn with_timeout(self, timeout_secs: u32) -> Self
pub fn with_timeout(self, timeout_secs: u32) -> Self
Set connection timeout.
Sourcepub fn with_read_timeout(self, read_timeout_secs: u32) -> Self
pub fn with_read_timeout(self, read_timeout_secs: u32) -> Self
Set read timeout.
Sourcepub fn with_reconnect(self, max_attempts: u32, delay_ms: u64) -> Self
pub fn with_reconnect(self, max_attempts: u32, delay_ms: u64) -> Self
Set maximum reconnection attempts (0 = disabled).
Sourcepub fn without_reconnect(self) -> Self
pub fn without_reconnect(self) -> Self
Disable automatic reconnection.
Sourcepub fn with_proxy(self, proxy: ProxyConfig) -> Self
pub fn with_proxy(self, proxy: ProxyConfig) -> Self
Set HTTP proxy configuration.
When a proxy is configured, the client will connect to the proxy server and use HTTP CONNECT to tunnel the connection to the NTRIP caster.
Sourcepub fn with_proxy_from_env(self) -> Self
pub fn with_proxy_from_env(self) -> Self
Configure proxy from environment variables.
Reads $HTTP_PROXY or $http_proxy environment variable.
If the variable is not set or invalid, no proxy is configured.
§Example
use ntrip_core::NtripConfig;
// Will use proxy from $HTTP_PROXY if set
let config = NtripConfig::new("caster.example.com", 2101, "MOUNT")
.with_proxy_from_env();Trait Implementations§
Source§impl Clone for NtripConfig
impl Clone for NtripConfig
Source§fn clone(&self) -> NtripConfig
fn clone(&self) -> NtripConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more