Struct surge_ping::Client
source · pub struct Client { /* private fields */ }
Expand description
If you want to pass the Client
in the task, please wrap it with Arc
: Arc<Client>
.
and can realize the simultaneous ping of multiple addresses when only one socket
is created.
Implementations§
source§impl Client
impl Client
sourcepub fn new(config: &Config) -> Result<Self>
pub fn new(config: &Config) -> Result<Self>
A client is generated according to the configuration. In fact, a AsyncSocket
is wrapped inside,
and you can clone to any task
at will.
sourcepub async fn pinger(&self, host: IpAddr, ident: PingIdentifier) -> Pinger
pub async fn pinger(&self, host: IpAddr, ident: PingIdentifier) -> Pinger
Create a Pinger
instance, you can make special configuration for this instance.
sourcepub fn get_socket(&self) -> AsyncSocket
pub fn get_socket(&self) -> AsyncSocket
Expose the underlying socket, if user wants to modify any options on it
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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