pub struct WifiCredentials {
pub ssid: String,
pub authentication_type: AuthenticationType,
pub visibility: Visibility,
}
Expand description
The credentials needed to completely connect to a wifi network.
Fields§
§ssid: String
The SSID of a wifi network is the name used to access it.
authentication_type: AuthenticationType
The authentication type of a wifi network determines the protocol used to access it and the password required to properly authenticate to it.
visibility: Visibility
The visibility of a wifi network determines if it can be seen by any device or if it must be known by SSID beforehand.
Implementations§
Source§impl WifiCredentials
impl WifiCredentials
Sourcepub fn encode(&self) -> String
pub fn encode(&self) -> String
Encode the credentials into the form expected for a wifi QR Code. Special characters (i.e. “;,:) will be escaped in the output.
§Examples
use wifi_qr_code::{AuthenticationType, Visibility, WifiCredentials};
let wifi_credentials = WifiCredentials {
ssid: String::from("example ssid"),
authentication_type: AuthenticationType::WPA(String::from("example password")),
visibility: Visibility::Hidden,
};
assert_eq!("WIFI:S:example ssid;T:WPA;P:example password;H:true;;", wifi_credentials.encode());
Auto Trait Implementations§
impl Freeze for WifiCredentials
impl RefUnwindSafe for WifiCredentials
impl Send for WifiCredentials
impl Sync for WifiCredentials
impl Unpin for WifiCredentials
impl UnwindSafe for WifiCredentials
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