pub struct Config {
pub bssid: String,
pub ssid: String,
pub wps_state: String,
pub wpa: i32,
pub key_mgmt: Option<String>,
pub group_cipher: Option<String>,
pub rsn_pairwise_cipher: Option<String>,
pub wpa_pairwise_cipher: Option<String>,
}Expand description
Configuration of the WiFi station
Fields§
§bssid: String§ssid: String§wps_state: String§wpa: i32§key_mgmt: Option<String>§group_cipher: Option<String>§rsn_pairwise_cipher: Option<String>§wpa_pairwise_cipher: Option<String>Implementations§
Source§impl Config
impl Config
Sourcepub fn from_response(response: &str) -> Result<Self, ConfigError>
pub fn from_response(response: &str) -> Result<Self, ConfigError>
Decode from the response sent from the hostapd
let resp = r#"
bssid=cc:7b:5c:1a:d2:21
ssid=WiFi-SSID
wps_state=disabled
wpa=2
key_mgmt=WPA-PSK
group_cipher=CCMP
rsn_pairwise_cipher=CCMP
wpa_pairwise_cipher=CCMP
"#;
let config = Config::from_response(resp).unwrap();
assert_eq!(config.wps_state, "disabled");
assert_eq!(config.wpa, 2);
assert_eq!(config.ssid, "WiFi-SSID");Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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