Struct surge_ping::ConfigBuilder
source · 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 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)
pub fn build(self) -> Config
Trait Implementations§
source§impl Debug for ConfigBuilder
impl Debug for ConfigBuilder
Auto Trait Implementations§
impl RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
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