Trait gio::prelude::NetworkMonitorExt
source · [−]pub trait NetworkMonitorExt: 'static {
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
sourcefn can_reach(
fn can_reach(
&self,
connectable: &impl IsA<SocketConnectable>,
cancellable: Option<&impl IsA<Cancellable>>
) -> Result<(), Error>
sourcefn can_reach_async<P: FnOnce(Result<(), Error>) + 'static>(
fn can_reach_async<P: FnOnce(Result<(), Error>) + 'static>(
&self,
connectable: &impl IsA<SocketConnectable>,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P
)
sourcefn can_reach_future(
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
sourcefn connect_network_changed<F: Fn(&Self, bool) + 'static>(
fn connect_network_changed<F: Fn(&Self, bool) + 'static>(
&self,
f: F
) -> SignalHandlerId
sourcefn connect_connectivity_notify<F: Fn(&Self) + 'static>(
fn connect_connectivity_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
sourcefn connect_network_available_notify<F: Fn(&Self) + 'static>(
fn connect_network_available_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
sourcefn connect_network_metered_notify<F: Fn(&Self) + 'static>(