[go: up one dir, main page]

Trait NetworkMonitorExt

Source
pub trait NetworkMonitorExt:
    IsA<NetworkMonitor>
    + Sealed
    + 'static {
    // Provided 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 { ... }
}

Provided 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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§