From 14ecdfe2365682e37df99569747b96943ec55426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Tue, 15 Jun 2021 13:41:45 +0200 Subject: doc mumlib state --- mumlib/src/state.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mumlib/src/state.rs') 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, + /// 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, + /// 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, + /// This channel's connected users. pub users: Vec, links: Vec>, //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, -- cgit v1.2.1