librefi_rs/src/connectors/types.rs
2022-01-02 22:15:23 +01:00

21 lines
615 B
Rust

pub trait Connector {
fn connect_to_network(&self, iface: &NetworkInterface, net: &Network, psk: Option<&str>) -> Result<bool, String>;
fn list_networks(&self, iface: &NetworkInterface) -> Result<Vec<Network>, String>;
fn list_network_interfaces(&self) -> Result<Vec<NetworkInterface>, String>;
}
#[derive(Debug, Default)]
pub struct Network {
pub ssid: String,
pub bssid: Option<String>,
pub channel: Option<u8>,
pub rssi: Option<i8>,
}
#[derive(Debug, Default)]
pub struct NetworkInterface {
pub enabled: bool,
pub machine_name: String,
pub human_name: Option<String>,
}