pub struct PathMonitor { /* private fields */ }Expand description
RAII guard for a running nw_path_monitor. Drop to stop receiving
updates.
Implementations§
Source§impl PathMonitor
impl PathMonitor
Sourcepub fn list_interfaces(&self) -> Vec<NetworkInterface>
pub fn list_interfaces(&self) -> Vec<NetworkInterface>
List the interfaces visible to the most recent path snapshot.
Sourcepub fn current_path(&self) -> Option<Path>
pub fn current_path(&self) -> Option<Path>
Copy the latest path snapshot observed by the monitor.
Sourcepub fn prohibit_interface_type(
&mut self,
interface_type: InterfaceType,
) -> &mut Self
pub fn prohibit_interface_type( &mut self, interface_type: InterfaceType, ) -> &mut Self
Prevent the monitor from considering paths that use an interface type.
Sourcepub fn set_cancel_handler<F>(&mut self, callback: F)
pub fn set_cancel_handler<F>(&mut self, callback: F)
Receive a callback when the monitor is cancelled.
Trait Implementations§
Source§impl Debug for PathMonitor
impl Debug for PathMonitor
Source§impl Drop for PathMonitor
impl Drop for PathMonitor
impl Send for PathMonitor
impl Sync for PathMonitor
Auto Trait Implementations§
impl Freeze for PathMonitor
impl RefUnwindSafe for PathMonitor
impl Unpin for PathMonitor
impl UnsafeUnpin for PathMonitor
impl UnwindSafe for PathMonitor
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