#[non_exhaustive]pub enum ProbeProtocol {
Icmp,
Udp,
Tcp,
}Expand description
Protocol to use for probing
Different protocols have different advantages:
- ICMP: Most accurate, but often requires root privileges
- UDP: Works without root on some systems, good compatibility
§Note
TCP support is planned for a future release but not yet implemented.
§Examples
use ftr::ProbeProtocol;
let protocol = ProbeProtocol::Udp;
println!("Using {} protocol", protocol.description());This enum is #[non_exhaustive]: new protocols may be added in minor
releases, so downstream matches must include a wildcard arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Icmp
ICMP Echo Request protocol
Udp
UDP protocol with high port numbers
Tcp
TCP SYN packets (not yet implemented)
Implementations§
Source§impl ProbeProtocol
impl ProbeProtocol
Sourcepub fn description(&self) -> &'static str
pub fn description(&self) -> &'static str
Get a human-readable description
Trait Implementations§
Source§impl Clone for ProbeProtocol
impl Clone for ProbeProtocol
Source§fn clone(&self) -> ProbeProtocol
fn clone(&self) -> ProbeProtocol
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ProbeProtocol
Source§impl Debug for ProbeProtocol
impl Debug for ProbeProtocol
Source§impl<'de> Deserialize<'de> for ProbeProtocol
impl<'de> Deserialize<'de> for ProbeProtocol
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ProbeProtocol
Source§impl PartialEq for ProbeProtocol
impl PartialEq for ProbeProtocol
Source§impl Serialize for ProbeProtocol
impl Serialize for ProbeProtocol
impl StructuralPartialEq for ProbeProtocol
Auto Trait Implementations§
impl Freeze for ProbeProtocol
impl RefUnwindSafe for ProbeProtocol
impl Send for ProbeProtocol
impl Sync for ProbeProtocol
impl Unpin for ProbeProtocol
impl UnsafeUnpin for ProbeProtocol
impl UnwindSafe for ProbeProtocol
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