pub struct SocketConfig {
pub send_buffer_size: usize,
pub recv_buffer_size: usize,
pub reuse_addr: bool,
pub reuse_port: bool,
pub nodelay: bool,
pub keepalive: Option<Duration>,
pub bind_interface: Option<String>,
pub fwmark: Option<u32>,
}Expand description
Socket configuration options.
Fields§
§send_buffer_size: usize§recv_buffer_size: usize§reuse_addr: bool§reuse_port: bool§nodelay: bool§keepalive: Option<Duration>§bind_interface: Option<String>Interface to bind to (for multi-homing).
fwmark: Option<u32>Mark for policy routing (Linux only).
Implementations§
Source§impl SocketConfig
impl SocketConfig
Sourcepub fn from_transport_config(config: &TransportConfig) -> Self
pub fn from_transport_config(config: &TransportConfig) -> Self
Create from transport config.
Sourcepub fn with_interface(self, interface: impl Into<String>) -> Self
pub fn with_interface(self, interface: impl Into<String>) -> Self
Set the interface to bind to.
Sourcepub fn with_fwmark(self, mark: u32) -> Self
pub fn with_fwmark(self, mark: u32) -> Self
Set the fwmark for policy routing.
Trait Implementations§
Source§impl Clone for SocketConfig
impl Clone for SocketConfig
Source§fn clone(&self) -> SocketConfig
fn clone(&self) -> SocketConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SocketConfig
impl Debug for SocketConfig
Auto Trait Implementations§
impl Freeze for SocketConfig
impl RefUnwindSafe for SocketConfig
impl Send for SocketConfig
impl Sync for SocketConfig
impl Unpin for SocketConfig
impl UnwindSafe for SocketConfig
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