pub struct Server {Show 13 fields
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,
pub tier: u8,
}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
tier: u8Server tier for prioritization (lower = higher priority, default: 0) Servers with lower tier numbers are tried first; higher tiers only when lower exhausted
Implementations§
Source§impl Server
impl Server
Sourcepub fn builder(host: impl Into<String>, port: Port) -> ServerBuilder
pub fn builder(host: impl Into<String>, port: Port) -> ServerBuilder
Create a builder for configuring a backend server
§Example
use nntp_proxy::config::Server;
use nntp_proxy::types::{Port, MaxConnections};
let config = Server::builder("news.example.com", Port::try_new(119).unwrap())
.name("Example Server")
.max_connections(MaxConnections::try_new(15).unwrap())
.build()
.unwrap();Trait Implementations§
Source§impl<'de> Deserialize<'de> for Server
impl<'de> Deserialize<'de> for Server
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>,
impl StructuralPartialEq for Server
Auto Trait Implementations§
impl Freeze for Server
impl RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnwindSafe for Server
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Code for Twhere
T: Serialize + DeserializeOwned,
impl<T> Code for Twhere
T: Serialize + DeserializeOwned,
Source§fn encode(&self, writer: &mut impl Write) -> Result<(), Error>
fn encode(&self, writer: &mut impl Write) -> Result<(), Error>
Source§fn decode(reader: &mut impl Read) -> Result<T, Error>
fn decode(reader: &mut impl Read) -> Result<T, Error>
Source§fn estimated_size(&self) -> usize
fn estimated_size(&self) -> usize
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more