pub struct DeadpoolConnectionProviderBuilder { /* private fields */ }Expand description
Builder for constructing DeadpoolConnectionProvider instances
Provides a fluent API for creating connection providers with optional TLS configuration.
§Examples
use nntp_proxy::pool::DeadpoolConnectionProvider;
use nntp_proxy::tls::TlsConfig;
// Basic provider without TLS
let provider = DeadpoolConnectionProvider::builder("news.example.com", 119)
.name("Example Server")
.max_connections(10)
.build()
.unwrap();
// Provider with TLS and authentication
let tls_config = TlsConfig::builder()
.enabled(true)
.verify_cert(true)
.build();
let provider = DeadpoolConnectionProvider::builder("secure.example.com", 563)
.name("Secure Server")
.max_connections(20)
.username("user")
.password("pass")
.tls_config(tls_config)
.build()
.unwrap();Implementations§
Source§impl DeadpoolConnectionProviderBuilder
impl DeadpoolConnectionProviderBuilder
Sourcepub fn new(host: impl Into<String>, port: u16) -> Self
pub fn new(host: impl Into<String>, port: u16) -> Self
Create a new builder with required connection parameters
§Arguments
host- Backend server hostname or IP addressport- Backend server port number
Sourcepub fn name(self, name: impl Into<String>) -> Self
pub fn name(self, name: impl Into<String>) -> Self
Set a friendly name for logging (defaults to “host:port”)
Sourcepub fn max_connections(self, max_size: usize) -> Self
pub fn max_connections(self, max_size: usize) -> Self
Set the maximum number of concurrent connections in the pool
Sourcepub fn tls_config(self, config: TlsConfig) -> Self
pub fn tls_config(self, config: TlsConfig) -> Self
Configure TLS settings for secure connections
Sourcepub fn build(self) -> Result<DeadpoolConnectionProvider>
pub fn build(self) -> Result<DeadpoolConnectionProvider>
Build the connection provider
§Errors
Returns an error if TLS initialization fails when TLS is enabled
Auto Trait Implementations§
impl Freeze for DeadpoolConnectionProviderBuilder
impl RefUnwindSafe for DeadpoolConnectionProviderBuilder
impl Send for DeadpoolConnectionProviderBuilder
impl Sync for DeadpoolConnectionProviderBuilder
impl Unpin for DeadpoolConnectionProviderBuilder
impl UnwindSafe for DeadpoolConnectionProviderBuilder
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