1pub mod providers;
2
3use self::providers::prelude::HotspotConfig;
4use crate::platforms::{WifiError, WifiInterface};
5use std::fmt;
6
7#[derive(Debug)]
9pub enum WifiHotspotError {
10 #[cfg(any(target_os = "windows", target_os = "linux"))]
12 CreationFailed,
13
14 #[cfg(target_os = "linux")]
17 FailedToStop(std::io::Error),
18
19 Other { kind: WifiError },
21}
22
23pub trait WifiHotspot: fmt::Debug + WifiInterface {
25 fn create_hotspot(
29 &mut self,
30 ssid: &str,
31 password: &str,
32 configuration: Option<&HotspotConfig>,
33 ) -> Result<bool, WifiHotspotError> {
34 let _a = ssid;
35 let _b = password;
36 let _c = configuration;
37
38 unimplemented!();
39 }
40
41 fn start_hotspot() -> Result<bool, WifiHotspotError> {
43 unimplemented!();
44 }
45
46 fn stop_hotspot(&mut self) -> Result<bool, WifiHotspotError> {
49 unimplemented!();
50 }
51}
52
53impl From<WifiError> for WifiHotspotError {
54 fn from(error: WifiError) -> Self {
55 WifiHotspotError::Other { kind: error }
56 }
57}