pub struct ServerConfig {
pub host: HostName,
pub port: Port,
pub name: ServerName,
pub username: Option<String>,
pub password: Option<String>,
pub max_connections: MaxConnections,
pub use_tls: bool,
pub tls_verify_cert: bool,
pub tls_cert_path: Option<String>,
pub connection_keepalive: Option<Duration>,
pub health_check_max_per_cycle: usize,
pub health_check_pool_timeout: Duration,
}Expand description
Configuration for a single backend server
Fields§
§host: HostName§port: Port§name: ServerName§username: Option<String>§password: Option<String>§max_connections: MaxConnectionsMaximum number of concurrent connections to this server
use_tls: boolEnable TLS/SSL for this backend connection
tls_verify_cert: boolVerify TLS certificates (recommended for production)
tls_cert_path: Option<String>Optional path to custom CA certificate
connection_keepalive: Option<Duration>Interval to send keep-alive commands (DATE) on idle connections None disables keep-alive (default)
health_check_max_per_cycle: usizeMaximum number of connections to check per health check cycle Lower values reduce pool contention but may take longer to detect all stale connections
health_check_pool_timeout: DurationTimeout when acquiring a connection for health checking Short timeout prevents blocking if pool is busy
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn builder(host: impl Into<String>, port: u16) -> ServerConfigBuilder
pub fn builder(host: impl Into<String>, port: u16) -> ServerConfigBuilder
Create a builder for constructing a ServerConfig
§Examples
use nntp_proxy::config::ServerConfig;
let config = ServerConfig::builder("news.example.com", 119)
.name("Example Server")
.max_connections(15)
.build()
.unwrap();Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ServerConfig
impl Debug for ServerConfig
Source§impl<'de> Deserialize<'de> for ServerConfig
impl<'de> Deserialize<'de> for ServerConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ServerConfig
impl PartialEq for ServerConfig
Source§impl Serialize for ServerConfig
impl Serialize for ServerConfig
impl StructuralPartialEq for ServerConfig
Auto Trait Implementations§
impl Freeze for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnwindSafe for ServerConfig
Blanket Implementations§
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
Mutably borrows from an owned value. Read more