rtc_datachannel/message/
message_channel_close.rs

1use super::*;
2use shared::error::Result;
3
4/// The data-part of an data-channel CLOSE message without the message type.
5///
6/// # Memory layout
7///
8/// ```plain
9/// 0                   1                   2                   3
10/// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
11///+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
12///|  Message Type |
13///+-+-+-+-+-+-+-+-+
14/// ```
15#[derive(Eq, PartialEq, Clone, Debug)]
16pub struct DataChannelClose; // internal usage only
17
18impl MarshalSize for DataChannelClose {
19    fn marshal_size(&self) -> usize {
20        0
21    }
22}
23
24impl Marshal for DataChannelClose {
25    fn marshal_to(&self, _buf: &mut [u8]) -> Result<usize> {
26        Ok(0)
27    }
28}
29
30impl Unmarshal for DataChannelClose {
31    fn unmarshal<B>(_buf: &mut B) -> Result<Self>
32    where
33        Self: Sized,
34        B: Buf,
35    {
36        Ok(Self)
37    }
38}