From 54153914d22180777b25a1d4f5089ed2ae2839df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Wed, 13 Jan 2021 23:19:05 +0100 Subject: de-pub links on mumlib channels --- mumlib/src/state.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'mumlib') 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, - pub links: Vec>, //to represent several walks through the tree to find channels its linked to pub max_users: u32, pub name: String, pub children: Vec, pub users: Vec, + + links: Vec>, //to represent several walks through the tree to find channels its linked to } impl Channel { + pub fn new( + name: String, + description: Option, + 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), -- cgit v1.2.1