diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2021-06-15 13:41:45 +0200 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2021-06-15 13:41:45 +0200 |
| commit | 14ecdfe2365682e37df99569747b96943ec55426 (patch) | |
| tree | 890567622f67a4824c497a13453b6af3ebd33742 /mumlib/src/state.rs | |
| parent | f03d0d1d8def80c905a59c2bba9722d21a95ffae (diff) | |
| download | mum-14ecdfe2365682e37df99569747b96943ec55426.tar.gz | |
doc mumlib state
Diffstat (limited to 'mumlib/src/state.rs')
| -rw-r--r-- | mumlib/src/state.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mumlib/src/state.rs b/mumlib/src/state.rs index 182a8fc..a5262e0 100644 --- a/mumlib/src/state.rs +++ b/mumlib/src/state.rs @@ -1,26 +1,38 @@ use serde::{Deserialize, Serialize}; use std::fmt; +/// The state of the currently connected Mumble server. #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Server { + /// State of the currently connected channel. pub channels: Channel, + /// The welcome text we received when we connected. pub welcome_text: Option<String>, + /// Our username. pub username: String, + /// The host (ip:port) of the server. pub host: String, } +/// A representation of a channel in a Mumble server. #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Channel { + /// The description of the channel, if set. pub description: Option<String>, + /// The maximum number of allowed users in this channel. pub max_users: u32, + /// The name of this channel. pub name: String, + /// Any children this channel has. pub children: Vec<Channel>, + /// This channel's connected users. pub users: Vec<User>, links: Vec<Vec<usize>>, //to represent several walks through the tree to find channels its linked to } impl Channel { + /// Create a new Channel representation. pub fn new( name: String, description: Option<String>, |
