pub enum IcmpEchoStatus {
Success,
TimedOut,
Unreachable,
Unknown,
}
Expand description
Status of an ICMP echo request/reply exchange.
This enum represents the different outcomes that can occur when sending an ICMP echo request and waiting for a reply.
Variants§
Success
The echo request was successful and a reply was received.
TimedOut
The echo request timed out - no reply was received within the timeout period.
Unreachable
The destination was unreachable (network, host, port, or protocol unreachable).
Unknown
An unknown error occurred during the ping operation.
Implementations§
Source§impl IcmpEchoStatus
impl IcmpEchoStatus
Sourcepub fn ok(self) -> Result<(), String>
pub fn ok(self) -> Result<(), String>
Converts the status to a Result
, returning Ok(())
for success or an error message for failures.
§Examples
use ping_async::IcmpEchoStatus;
let status = IcmpEchoStatus::Success;
assert!(status.ok().is_ok());
let status = IcmpEchoStatus::TimedOut;
assert!(status.ok().is_err());
Trait Implementations§
Source§impl Clone for IcmpEchoStatus
impl Clone for IcmpEchoStatus
Source§fn clone(&self) -> IcmpEchoStatus
fn clone(&self) -> IcmpEchoStatus
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 IcmpEchoStatus
impl Debug for IcmpEchoStatus
Source§impl PartialEq for IcmpEchoStatus
impl PartialEq for IcmpEchoStatus
impl Copy for IcmpEchoStatus
impl Eq for IcmpEchoStatus
impl StructuralPartialEq for IcmpEchoStatus
Auto Trait Implementations§
impl Freeze for IcmpEchoStatus
impl RefUnwindSafe for IcmpEchoStatus
impl Send for IcmpEchoStatus
impl Sync for IcmpEchoStatus
impl Unpin for IcmpEchoStatus
impl UnwindSafe for IcmpEchoStatus
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