Skip to main content

NetworkMonitorExt

Trait NetworkMonitorExt 

Source
pub trait NetworkMonitorExt: IsA<NetworkMonitor> + 'static {
    // Provided methods
    fn can_reach(
        &self,
        connectable: &impl IsA<SocketConnectable>,
        cancellable: Option<&impl IsA<Cancellable>>,
    ) -> Result<(), Error> { ... }
    fn can_reach_async<P>(
        &self,
        connectable: &impl IsA<SocketConnectable>,
        cancellable: Option<&impl IsA<Cancellable>>,
        callback: P,
    )
       where P: FnOnce(Result<(), Error>) + 'static { ... }
    fn can_reach_future(
        &self,
        connectable: &(impl IsA<SocketConnectable> + Clone + 'static),
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>>>> { ... }
    fn connectivity(&self) -> NetworkConnectivity { ... }
    fn is_network_available(&self) -> bool { ... }
    fn is_network_metered(&self) -> bool { ... }
    fn connect_network_changed<F>(&self, f: F) -> SignalHandlerId
       where F: Fn(&Self, bool) + 'static { ... }
    fn connect_connectivity_notify<F>(&self, f: F) -> SignalHandlerId
       where F: Fn(&Self) + 'static { ... }
    fn connect_network_available_notify<F>(&self, f: F) -> SignalHandlerId
       where F: Fn(&Self) + 'static { ... }
    fn connect_network_metered_notify<F>(&self, f: F) -> SignalHandlerId
       where F: Fn(&Self) + 'static { ... }
}

Provided Methods§

Source

fn can_reach( &self, connectable: &impl IsA<SocketConnectable>, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>

Source

fn can_reach_async<P>( &self, connectable: &impl IsA<SocketConnectable>, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
where P: FnOnce(Result<(), Error>) + 'static,

Source

fn can_reach_future( &self, connectable: &(impl IsA<SocketConnectable> + Clone + 'static), ) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>

Source

fn connectivity(&self) -> NetworkConnectivity

Source

fn is_network_available(&self) -> bool

Source

fn is_network_metered(&self) -> bool

Source

fn connect_network_changed<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self, bool) + 'static,

Source

fn connect_connectivity_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

Source

fn connect_network_available_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

Source

fn connect_network_metered_notify<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self) + 'static,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§