pub struct ConnectionStatus {
pub mode: WifiMode,
pub connection_name: Option<String>,
pub ip_address: Option<String>,
pub has_internet: bool,
pub interface: String,
}Expand description
Detailed status of the current WiFi connection.
Returned by WifiManager::status().
§Example
use rpi_host::WifiManager;
let wifi = WifiManager::new()?;
let status = wifi.status()?;
println!("Interface: {}", status.interface);
println!("Mode: {}", status.mode);
println!("Connected to: {:?}", status.connection_name);
println!("IP: {:?}", status.ip_address);
println!("Internet: {}", status.has_internet);Fields§
§mode: WifiModeCurrent operating mode.
connection_name: Option<String>Name of the active connection.
For client mode, this is the SSID. For hotspot mode, this is the hotspot name.
None if disconnected.
ip_address: Option<String>IP address assigned to the interface.
None if not connected or no IP assigned yet.
has_internet: boolWhether internet is reachable.
Only meaningful in client mode. Always false in hotspot mode.
interface: StringThe wireless interface name (e.g., “wlan0”).
Implementations§
Source§impl ConnectionStatus
impl ConnectionStatus
Sourcepub fn disconnected(interface: impl Into<String>) -> Self
pub fn disconnected(interface: impl Into<String>) -> Self
Create a disconnected status for the given interface.
Trait Implementations§
Source§impl Clone for ConnectionStatus
impl Clone for ConnectionStatus
Source§fn clone(&self) -> ConnectionStatus
fn clone(&self) -> ConnectionStatus
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ConnectionStatus
impl RefUnwindSafe for ConnectionStatus
impl Send for ConnectionStatus
impl Sync for ConnectionStatus
impl Unpin for ConnectionStatus
impl UnwindSafe for ConnectionStatus
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