pub struct NntpProxyBuilder { /* private fields */ }Expand description
Builder for constructing an NntpProxy with optional configuration overrides
§Examples
Basic usage with defaults:
let config = load_config("config.toml")?;
let proxy = NntpProxyBuilder::new(config)
    .with_routing_mode(RoutingMode::Hybrid)
    .build()?;With custom buffer pool size:
let config = load_config("config.toml")?;
let proxy = NntpProxyBuilder::new(config)
    .with_routing_mode(RoutingMode::PerCommand)
    .with_buffer_pool_size(512 * 1024)  // 512KB buffers
    .with_buffer_pool_count(64)         // 64 buffers
    .build()?;Implementations§
Source§impl NntpProxyBuilder
 
impl NntpProxyBuilder
Sourcepub fn new(config: Config) -> Self
 
pub fn new(config: Config) -> Self
Create a new builder with the given configuration
The routing mode defaults to Standard (1:1) mode.
Sourcepub fn with_routing_mode(self, mode: RoutingMode) -> Self
 
pub fn with_routing_mode(self, mode: RoutingMode) -> Self
Set the routing mode
Available modes:
- Standard: 1:1 client-to-backend mapping (default)
- PerCommand: Each command routes to a different backend
- Hybrid: Starts in per-command mode, switches to stateful when needed
Sourcepub fn with_buffer_pool_size(self, size: usize) -> Self
 
pub fn with_buffer_pool_size(self, size: usize) -> Self
Override the default buffer pool size (256KB)
This affects the size of each buffer in the pool. Larger buffers can improve throughput for large article transfers but use more memory.
Sourcepub fn with_buffer_pool_count(self, count: usize) -> Self
 
pub fn with_buffer_pool_count(self, count: usize) -> Self
Override the default buffer pool count (32)
This affects how many buffers are pre-allocated. Should roughly match the expected number of concurrent connections.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NntpProxyBuilder
impl RefUnwindSafe for NntpProxyBuilder
impl Send for NntpProxyBuilder
impl Sync for NntpProxyBuilder
impl Unpin for NntpProxyBuilder
impl UnwindSafe for NntpProxyBuilder
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