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
//! # Qonductor
//!
//! Rust implementation of the Qobuz Connect protocol.
//!
//! ## Quick Start
//!
//! ```ignore
//! use qonductor::{SessionManager, DeviceConfig, SessionEvent, Command, Notification, msg};
//!
//! #[tokio::main]
//! async fn main() -> qonductor::Result<()> {
//! let mut manager = SessionManager::start(7864).await?;
//! let mut session = manager.add_device(DeviceConfig::new("Living Room", "your_app_id")).await?;
//!
//! tokio::spawn(async move { manager.run().await });
//!
//! while let Some(event) = session.recv().await {
//! match event {
//! SessionEvent::Command(cmd) => match cmd {
//! Command::SetState { cmd, respond } => {
//! respond.send(msg::QueueRendererState { /* ... */ });
//! }
//! Command::SetActive { respond, .. } => {
//! respond.send(ActivationState { /* ... */ });
//! }
//! Command::Heartbeat { respond } => {
//! respond.send(None);
//! }
//! },
//! SessionEvent::Notification(n) => match n {
//! Notification::Connected => println!("Connected!"),
//! _ => {}
//! },
//! }
//! }
//! Ok(())
//! }
//! ```
// Internal modules
pub
pub
pub
// Re-export main public API
pub use SessionManager;
pub use ;
pub use ;
pub use ;
pub use ;
pub use DeviceTypeExt;
pub use format_qconnect_message;
pub use Error;
pub use *;
/// Result type for qonductor operations.
pub type Result<T> = Result;
/// Generated protobuf types.