Struct IcmpTarget

Source
pub struct IcmpTarget { /* private fields */ }
Expand description

Target to check if a system can be reached via ICMP.

§Notes

IcmpTargets use the ping command to perform availability checks. Some administrator blackhole ICMP packets, leading to systems that look unavailable although they can be reached with a TcpTarget.

Implementations§

Source§

impl IcmpTarget

Source

pub fn new(fqhn: Fqhn, resolve_policy: ResolvePolicy) -> Self

Construct an IcmpTarget.

§Arguments
  • fqhn: string containing “fully qualified domain name” e.g. “::1”, “localhost”.
  • resolve_policy: the ResolvePolicy to use for this Target.
§Returns

Instance of IcmpTarget.

§Notes

For more convenience use the implementations of trait “From” and “FromStr”.

Source

pub fn set_resolve_policy(self, resolve_policy: ResolvePolicy) -> Self

Set a new ResolvePolicy for name resolution.

Source

pub fn get_fqhn(&self) -> &Fqhn

Get a reference to the Fqhn.

Source

pub fn get_resolve_policy(&self) -> &ResolvePolicy

Get a reference to the ResolvePolicy in use.

Trait Implementations§

Source§

impl Debug for IcmpTarget

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<IpAddr> for IcmpTarget

Source§

fn from(addr: IpAddr) -> Self

Converts to this type from the input type.
Source§

impl From<Ipv4Addr> for IcmpTarget

Source§

fn from(addr: Ipv4Addr) -> Self

Converts to this type from the input type.
Source§

impl From<Ipv6Addr> for IcmpTarget

Source§

fn from(addr: Ipv6Addr) -> Self

Converts to this type from the input type.
Source§

impl FromStr for IcmpTarget

Source§

type Err = ParseTargetError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<IcmpTarget, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Target for IcmpTarget

Source§

fn get_id(&self) -> String

Get a Targets identifier. Read more
Source§

fn check_availability(&self) -> Result<Status, CheckTargetError>

Check if a Target is currently available. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.