pub struct ConfigBuilder { /* private fields */ }Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
Sourcepub fn bind(self, bind: SocketAddr) -> Self
pub fn bind(self, bind: SocketAddr) -> Self
Binds this socket to the specified address.
This function directly corresponds to the bind(2) function on Windows
and Unix.
Sourcepub fn interface(self, interface: &str) -> Self
pub fn interface(self, interface: &str) -> Self
Sets the value for the SO_BINDTODEVICE option on this socket.
If a socket is bound to an interface, only packets received from that
particular interface are processed by the socket. Note that this only
works for some socket types, particularly AF_INET sockets.
Sourcepub fn interface_index(self, interface_index: NonZeroU32) -> Self
pub fn interface_index(self, interface_index: NonZeroU32) -> Self
Sets the value for the IP_BOUND_IF, IPV6_BOUND_IF or SO_BINDTOIFINDEX option on this socket depending on the platform and IP address family.
Sourcepub fn ttl(self, ttl: u32) -> Self
pub fn ttl(self, ttl: u32) -> Self
Set the value of the IP_TTL option for this socket.
This value sets the time-to-live field that is used in every packet sent from this socket.
pub fn fib(self, fib: u32) -> Self
Sourcepub fn kind(self, kind: ICMP) -> Self
pub fn kind(self, kind: ICMP) -> Self
Identify which ICMP the socket handles.(default: ICMP::V4)
Sourcepub fn sock_type_hint(self, typ: Type) -> Self
pub fn sock_type_hint(self, typ: Type) -> Self
Try to open the socket with provided at first (DGRAM or RAW)