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

Required Methods§

source

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

source

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

source

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

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: Fn(&Self, bool) + 'static>( &self, f: F ) -> SignalHandlerId

source

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

source

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

source

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

Implementors§