pub struct TcpServerConfigBuilder { /* private fields */ }Expand description
Builder for TcpServerConfig using the builder pattern.
All fields are optional and will use defaults from TcpServerConfig::default() if not explicitly set.
Implementations§
Source§impl TcpServerConfigBuilder
impl TcpServerConfigBuilder
Sourcepub fn address(self, address: SocketAddr) -> Self
pub fn address(self, address: SocketAddr) -> Self
Set the address to bind to
Sourcepub fn buffer_size(self, size: usize) -> Self
pub fn buffer_size(self, size: usize) -> Self
Set the buffer size for connections
Sourcepub fn max_connections(self, max: usize) -> Self
pub fn max_connections(self, max: usize) -> Self
Set the maximum number of connections
Sourcepub fn keep_alive(self, duration: Option<Duration>) -> Self
pub fn keep_alive(self, duration: Option<Duration>) -> Self
Set SO_KEEPALIVE duration
Sourcepub fn build(self) -> TcpServerConfig
pub fn build(self) -> TcpServerConfig
Build the TcpServerConfig
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TcpServerConfigBuilder
impl RefUnwindSafe for TcpServerConfigBuilder
impl Send for TcpServerConfigBuilder
impl Sync for TcpServerConfigBuilder
impl Unpin for TcpServerConfigBuilder
impl UnsafeUnpin for TcpServerConfigBuilder
impl UnwindSafe for TcpServerConfigBuilder
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