[][src]Struct system_configuration::network_reachability::SCNetworkReachability

pub struct SCNetworkReachability(_);

A network address or host for which the connectivity can be determined.

See SCNetworkReachability for details.

Implementations

impl SCNetworkReachability[src]

pub fn from_addr_pair(
    local: SocketAddr,
    remote: SocketAddr
) -> SCNetworkReachability
[src]

Construct a SCNetworkReachability struct with a local and a remote socket address.

See SCNetworkReachabilityCreateWithAddressPair for details.

pub fn from_host(host: &CStr) -> Option<Self>[src]

Construct a Reachability from either a hostname or a network node

See SCNetworkReachabilityCreateWithName for details.

pub fn reachability(&self) -> Result<ReachabilityFlags, ReachabilityError>[src]

Return a flag indicating whether the specified network address is reachable.

See SCNetworkReachabilityGetFlags for details.

pub fn schedule_with_runloop(
    &self,
    run_loop: &CFRunLoop,
    run_loop_mode: CFStringRef
) -> Result<(), SchedulingError>
[src]

Schedule callback with runloop.

See SCNetworkReachabilityScheduleFromRunLoop for details.

pub fn unschedule_from_runloop(
    &self,
    run_loop: &CFRunLoop,
    run_loop_mode: CFStringRef
) -> Result<(), UnschedulingError>
[src]

Unschedule from run loop.

See SCNetworkReachabilityUnscheduleFromRunLoop for details.

pub fn set_callback<F: Fn(ReachabilityFlags) + Sync + Send>(
    &mut self,
    callback: F
) -> Result<(), SetCallbackError>
[src]

Sets callback that is run whenever network connectivity changes. For the callback to be invoked, the SCNetworkReachability has to be registered on a run loop. Calling this function multiple times will clear the subsequently set callback.

See SCNetworkReachabilityContext for details.

Trait Implementations

impl Clone for SCNetworkReachability[src]

impl ConcreteCFType for SCNetworkReachability[src]

impl Drop for SCNetworkReachability[src]

impl Eq for SCNetworkReachability[src]

impl From<SocketAddr> for SCNetworkReachability[src]

impl PartialEq<SCNetworkReachability> for SCNetworkReachability[src]

impl TCFType for SCNetworkReachability[src]

type Ref = SCNetworkReachabilityRef

The reference type wrapped inside this type.

impl<'a> ToVoid<SCNetworkReachability> for &'a SCNetworkReachability[src]

impl ToVoid<SCNetworkReachability> for SCNetworkReachability[src]

impl ToVoid<SCNetworkReachability> for SCNetworkReachabilityRef[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> FromMutVoid for T where
    T: TCFType
[src]

impl<T> FromVoid for T where
    T: TCFType
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.