Chore(Stage): Some Refactoring

This commit is contained in:
Tochukwu Nkemdilim
2018-07-18 17:23:51 +01:00
parent 468368bc30
commit e8b83bf245
10 changed files with 361 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
mod providers;
// pub use self::providers::Machine;
use platforms::{WifiError, WifiInterface};
use std::fmt;
#[derive(Debug)]
pub enum WifiHotspotError {
CreationFailed,
Other { kind: WifiError },
}
/// Adds support for wifi hotspot functionality
pub trait WifiHotspot: fmt::Debug + WifiInterface {
/// Creates wifi hotspot service for host machine. This only creats the wifi network,
/// and isn't responsible for initiating the serving of the wifi network process.
/// To begin serving the hotspot, use ```start_hotspot()```.
fn create_hotspot(ssid: &str, password: &str) -> Result<bool, WifiHotspotError>;
/// Start serving publicly an already created wifi hotspot.
fn start_hotspot() -> Result<bool, WifiHotspotError>;
/// Stop serving a wifi network.
///
/// > All users connected will automatically be disconnected.
fn stop_hotspot() -> Result<bool, WifiHotspotError>;
}