[−][src]Struct system_configuration::network_reachability::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]
local: SocketAddr,
remote: SocketAddr
) -> SCNetworkReachability
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]
&self,
run_loop: &CFRunLoop,
run_loop_mode: CFStringRef
) -> Result<(), SchedulingError>
Schedule callback with runloop.
See SCNetworkReachabilityScheduleFromRunLoop for details.
pub fn unschedule_from_runloop(
&self,
run_loop: &CFRunLoop,
run_loop_mode: CFStringRef
) -> Result<(), UnschedulingError>[src]
&self,
run_loop: &CFRunLoop,
run_loop_mode: CFStringRef
) -> Result<(), UnschedulingError>
Unschedule from run loop.
See SCNetworkReachabilityUnscheduleFromRunLoop for details.
pub fn set_callback<F: Fn(ReachabilityFlags) + Sync + Send>(
&mut self,
callback: F
) -> Result<(), SetCallbackError>[src]
&mut self,
callback: F
) -> Result<(), SetCallbackError>
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]
fn clone(&self) -> SCNetworkReachability[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl ConcreteCFType for SCNetworkReachability[src]
impl Drop for SCNetworkReachability[src]
impl Eq for SCNetworkReachability[src]
impl From<SocketAddr> for SCNetworkReachability[src]
fn from(addr: SocketAddr) -> Self[src]
impl PartialEq<SCNetworkReachability> for SCNetworkReachability[src]
fn eq(&self, other: &SCNetworkReachability) -> bool[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool1.0.0[src]
impl TCFType for SCNetworkReachability[src]
type Ref = SCNetworkReachabilityRef
The reference type wrapped inside this type.
fn as_concrete_TypeRef(&self) -> SCNetworkReachabilityRef[src]
unsafe fn wrap_under_get_rule(reference: SCNetworkReachabilityRef) -> Self[src]
fn as_CFTypeRef(&self) -> CFTypeRef[src]
unsafe fn wrap_under_create_rule(reference: SCNetworkReachabilityRef) -> Self[src]
fn type_id() -> CFTypeID[src]
fn as_CFType(&self) -> CFType[src]
fn into_CFType(self) -> CFType[src]
fn retain_count(&self) -> isize[src]
fn type_of(&self) -> usize[src]
fn show(&self)[src]
fn instance_of<OtherCFType>(&self) -> bool where
OtherCFType: TCFType, [src]
OtherCFType: TCFType,
impl<'a> ToVoid<SCNetworkReachability> for &'a SCNetworkReachability[src]
impl ToVoid<SCNetworkReachability> for SCNetworkReachability[src]
impl ToVoid<SCNetworkReachability> for SCNetworkReachabilityRef[src]
Auto Trait Implementations
impl RefUnwindSafe for SCNetworkReachability
impl !Send for SCNetworkReachability
impl !Sync for SCNetworkReachability
impl Unpin for SCNetworkReachability
impl UnwindSafe for SCNetworkReachability
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T> FromMutVoid for T where
T: TCFType, [src]
T: TCFType,
unsafe fn from_mut_void<'a>(x: *mut c_void) -> ItemMutRef<'a, T>[src]
impl<T> FromVoid for T where
T: TCFType, [src]
T: TCFType,
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,