pub struct ScanResult {
pub mac: String,
pub frequency: String,
pub signal: isize,
pub flags: String,
pub name: String,
}Expand description
The result from scanning for networks.
Fields§
§mac: String§frequency: String§signal: isize§flags: String§name: StringImplementations§
Source§impl ScanResult
impl ScanResult
Sourcepub fn vec_from_str(response: &str) -> ParseResult<Arc<Vec<ScanResult>>>
pub fn vec_from_str(response: &str) -> ParseResult<Arc<Vec<ScanResult>>>
Parses lines from a scan result
use wifi_ctrl::sta::ScanResult;
let results = ScanResult::vec_from_str(r#"bssid / frequency / signal level / flags / ssid
00:5f:67:90:da:64 2417 -35 [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS] TP-Link DA64
e0:91:f5:7d:11:c0 2462 -33 [WPA2-PSK-CCMP][WPS][ESS] ¯\\_(\xe3\x83\x84)_/¯
"#).unwrap();
assert_eq!(results[0].mac, "00:5f:67:90:da:64");
assert_eq!(results[0].name, "TP-Link DA64");
assert_eq!(results[1].signal, -33);
assert_eq!(results[1].name, r#"¯\_(ツ)_/¯"#);Trait Implementations§
Source§impl Clone for ScanResult
impl Clone for ScanResult
Source§fn clone(&self) -> ScanResult
fn clone(&self) -> ScanResult
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScanResult
impl Debug for ScanResult
Auto Trait Implementations§
impl Freeze for ScanResult
impl RefUnwindSafe for ScanResult
impl Send for ScanResult
impl Sync for ScanResult
impl Unpin for ScanResult
impl UnsafeUnpin for ScanResult
impl UnwindSafe for ScanResult
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