1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//! Network management via NetworkManager D-Bus.
//!
//! # Quick Start
//!
//! ```rust,no_run
//! use wayle_network::NetworkService;
//!
//! # async fn example() -> Result<(), wayle_network::Error> {
//! let net = NetworkService::new().await?;
//!
//! // Check WiFi state (wifi is reactive for hot-plug support)
//! if let Some(wifi) = net.wifi.get() {
//! println!("WiFi enabled: {}", wifi.enabled.get());
//! for ap in wifi.access_points.get().iter() {
//! println!(" {} ({}%)", ap.ssid.get(), ap.strength.get());
//! }
//! }
//!
//! // Check wired state
//! if let Some(wired) = net.wired.get() {
//! println!("Ethernet status: {:?}", wired.connectivity.get());
//! }
//! # Ok(())
//! # }
//! ```
//!
//! # Watching for Changes
//!
//! ```rust,no_run
//! use wayle_network::NetworkService;
//! use futures::StreamExt;
//!
//! # async fn example() -> Result<(), wayle_network::Error> {
//! # let net = NetworkService::new().await?;
//! if let Some(wifi) = net.wifi.get() {
//! let mut stream = wifi.access_points.watch();
//! while let Some(aps) = stream.next().await {
//! println!("{} networks visible", aps.len());
//! }
//! }
//! # Ok(())
//! # }
//! ```
//!
//! # WiFi Control
//!
//! ```rust,no_run
//! # use wayle_network::NetworkService;
//! # async fn example() -> Result<(), wayle_network::Error> {
//! # let net = NetworkService::new().await?;
//! if let Some(wifi) = net.wifi.get() {
//! // Enable WiFi
//! wifi.set_enabled(true).await?;
//!
//! // List available networks
//! for ap in wifi.access_points.get().iter() {
//! println!("{}: {:?} ({}%)",
//! ap.ssid.get(),
//! ap.security.get(),
//! ap.strength.get()
//! );
//! }
//! }
//! # Ok(())
//! # }
//! ```
//!
//! # Reactive Properties
//!
//! All fields are [`Property<T>`](wayle_core::Property):
//! - `.get()` - Current value snapshot
//! - `.watch()` - Stream yielding on changes
//!
//! # Service Fields
//!
//! | Field | Type | Description |
//! |-------|------|-------------|
//! | `wifi` | `Property<Option<Arc<Wifi>>>` | WiFi device (reactive for hot-plug) |
//! | `wired` | `Property<Option<Arc<Wired>>>` | Ethernet device (reactive for hot-plug) |
//! | `settings` | `Settings` | Connection profile management |
//! | `primary` | `Property<ConnectionType>` | Active connection type |
/// Core network domain models.
/// Network type definitions
/// WiFi device functionality
/// Wired device functionality
pub use Error;
pub use NetworkService;
;