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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#[derive(Debug, Clone)]
pub struct StreamConfig(Box<StreamConfigInner>);
impl StreamConfig {
#[must_use]
pub fn new(room_id: u64, uid: u64, token: String, servers: Vec<String>) -> Self {
Self(Box::new(StreamConfigInner {
room_id,
uid,
token,
servers,
}))
}
}
impl StreamConfig {
#[must_use]
pub const fn room_id(&self) -> u64 {
self.0.room_id
}
#[must_use]
pub const fn uid(&self) -> u64 {
self.0.uid
}
#[must_use]
pub fn token(&self) -> &str {
&self.0.token
}
#[must_use]
pub fn servers(&self) -> &[String] {
&self.0.servers
}
}
#[derive(Debug, Clone)]
struct StreamConfigInner {
room_id: u64,
uid: u64,
token: String,
servers: Vec<String>,
}