pub struct WifiScope { /* private fields */ }Expand description
Operations scoped to a single Wi-Fi interface.
Created via NetworkManager::wifi.
Cheap to construct (Clone is fine).
Implementations§
Source§impl WifiScope
impl WifiScope
Sourcepub async fn list_networks(&self) -> Result<Vec<Network>>
pub async fn list_networks(&self) -> Result<Vec<Network>>
List visible networks on this interface (grouped by SSID).
Sourcepub async fn list_access_points(&self) -> Result<Vec<AccessPoint>>
pub async fn list_access_points(&self) -> Result<Vec<AccessPoint>>
List individual access points on this interface (one per BSSID).
Sourcepub async fn connect(&self, ssid: &str, creds: WifiSecurity) -> Result<()>
pub async fn connect(&self, ssid: &str, creds: WifiSecurity) -> Result<()>
Connect this interface to the given SSID.
Sourcepub async fn connect_to_bssid(
&self,
ssid: &str,
bssid: Option<&str>,
creds: WifiSecurity,
) -> Result<()>
pub async fn connect_to_bssid( &self, ssid: &str, bssid: Option<&str>, creds: WifiSecurity, ) -> Result<()>
Connect this interface to a specific BSSID for the given SSID.
Sourcepub async fn disconnect(&self) -> Result<()>
pub async fn disconnect(&self) -> Result<()>
Disconnect this interface from its active network, if any.
Sourcepub async fn set_enabled(&self, enabled: bool) -> Result<()>
pub async fn set_enabled(&self, enabled: bool) -> Result<()>
Enable or disable autoconnect on this interface only.
Independent of NetworkManager’s global Wi-Fi killswitch
(set_wireless_enabled).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WifiScope
impl !RefUnwindSafe for WifiScope
impl Send for WifiScope
impl Sync for WifiScope
impl Unpin for WifiScope
impl UnsafeUnpin for WifiScope
impl !UnwindSafe for WifiScope
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