mirror of
https://github.com/pcvolkmer/arsnova-client.git
synced 2025-04-19 19:16:51 +00:00
add WsSubscribeMessage struct
This commit is contained in:
parent
1769809e1a
commit
45166015ea
@ -81,6 +81,28 @@ impl Display for WsConnectMessage {
|
||||
}
|
||||
}
|
||||
|
||||
struct WsSubscribeMessage {
|
||||
room_id: String,
|
||||
}
|
||||
|
||||
impl WsSubscribeMessage {
|
||||
fn new(room_id: &str) -> WsSubscribeMessage {
|
||||
WsSubscribeMessage {
|
||||
room_id: room_id.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for WsSubscribeMessage {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
let str = format!(
|
||||
"SUBSCRIBE\nid:sub-6\ndestination:/topic/{}.stream\n\n\0",
|
||||
self.room_id
|
||||
);
|
||||
write!(f, "{}", str)
|
||||
}
|
||||
}
|
||||
|
||||
struct WsSubscribeFeedbackMessage {
|
||||
room_id: String,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user