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
use std::collections::HashSet;

use nson::{
    Message,
    message_id::MessageId
};

use crate::Wire;

#[derive(Debug)]
pub struct Slot {
    pub token: usize,
    pub id: MessageId,
    pub root: bool,
    pub joined: bool,
    pub chans: HashSet<String>,
    pub share_chans: HashSet<String>,
    pub bind: HashSet<usize>,
    pub bound: HashSet<usize>,
    pub wire: Wire<Message>
}

impl Slot {
    pub fn new(token: usize, id: MessageId, root: bool, wire: Wire<Message>) -> Self {
        Self {
            token,
            id,
            root,
            joined: false,
            chans: HashSet::new(),
            share_chans: HashSet::new(),
            bind: HashSet::new(),
            bound: HashSet::new(),
            wire
        }
    }
}