Struct surge_ping::Pinger [−][src]
pub struct Pinger { /* fields omitted */ }A Ping struct represents the state of one particular ping instance.
Examples
use std::time::Duration; use surge_ping::Pinger; #[tokio::main] async fn main() { let mut pinger = Pinger::new("114.114.114.114".parse().unwrap()).unwrap(); pinger.size(56).timeout(Duration::from_secs(1)); let result = pinger.ping(0).await; println!("{:?}", result); }
Implementations
impl Pinger[src]
impl Pinger[src]pub fn bind_device(
&mut self,
interface: Option<&[u8]>
) -> Result<&mut Pinger, SurgeError>[src]
pub fn bind_device(
&mut self,
interface: Option<&[u8]>
) -> Result<&mut Pinger, SurgeError>[src]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.
If interface is None or an empty string it removes the binding.
This function is only available on Fuchsia and Linux.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Pinger
impl Send for Pinger
impl Sync for Pinger
impl Unpin for Pinger
impl !UnwindSafe for Pinger
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,