pub struct TcpConfig {
pub domain: Domain,
pub sock_type: Type,
pub bind_addr: Option<SocketAddr>,
pub nonblocking: bool,
pub reuseaddr: Option<bool>,
pub nodelay: Option<bool>,
pub linger: Option<Duration>,
pub ttl: Option<u32>,
pub bind_device: Option<String>,
}Expand description
Configuration options for a TCP socket.
Fields§
§domain: Domain§sock_type: Type§bind_addr: Option<SocketAddr>§nonblocking: bool§reuseaddr: Option<bool>§nodelay: Option<bool>§linger: Option<Duration>§ttl: Option<u32>§bind_device: Option<String>Implementations§
Source§impl TcpConfig
impl TcpConfig
pub fn with_bind(self, addr: SocketAddr) -> Self
pub fn with_nonblocking(self, flag: bool) -> Self
pub fn with_reuseaddr(self, flag: bool) -> Self
pub fn with_nodelay(self, flag: bool) -> Self
pub fn with_linger(self, dur: Duration) -> Self
pub fn with_ttl(self, ttl: u32) -> Self
pub fn with_bind_device(self, iface: impl Into<String>) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TcpConfig
impl RefUnwindSafe for TcpConfig
impl Send for TcpConfig
impl Sync for TcpConfig
impl Unpin for TcpConfig
impl UnwindSafe for TcpConfig
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