aboutsummaryrefslogtreecommitdiffstats
path: root/mumlib
diff options
context:
space:
mode:
Diffstat (limited to 'mumlib')
-rw-r--r--mumlib/src/state.rs18
1 files changed, 17 insertions, 1 deletions
diff --git a/mumlib/src/state.rs b/mumlib/src/state.rs
index 6fad332..772e822 100644
--- a/mumlib/src/state.rs
+++ b/mumlib/src/state.rs
@@ -12,14 +12,30 @@ pub struct Server {
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Channel {
pub description: Option<String>,
- pub links: Vec<Vec<usize>>, //to represent several walks through the tree to find channels its linked to
pub max_users: u32,
pub name: String,
pub children: Vec<Channel>,
pub users: Vec<User>,
+
+ links: Vec<Vec<usize>>, //to represent several walks through the tree to find channels its linked to
}
impl Channel {
+ pub fn new(
+ name: String,
+ description: Option<String>,
+ max_users: u32,
+ ) -> Self {
+ Self {
+ description,
+ max_users,
+ name,
+ children: Vec::new(),
+ users: Vec::new(),
+
+ links: Vec::new(),
+ }
+ }
pub fn iter(&self) -> Iter<'_> {
Iter {
me: Some(&self),