rtc_dtls/handshake/handshake_message_server_hello_done.rs
1#[cfg(test)]
2mod handshake_message_server_hello_done_test;
3
4use super::*;
5
6use std::io::{Read, Write};
7
8#[derive(Clone, Debug, PartialEq, Eq)]
9/// Marks the end of the server's first flight. Carries no fields.
10pub struct HandshakeMessageServerHelloDone;
11
12impl HandshakeMessageServerHelloDone {
13 /// The handshake type that identifies this message on the wire.
14 pub fn handshake_type(&self) -> HandshakeType {
15 HandshakeType::ServerHelloDone
16 }
17
18 /// The encoded size of this message in bytes.
19 pub fn size(&self) -> usize {
20 0
21 }
22
23 /// Encodes this message to `writer`.
24 ///
25 /// # Errors
26 ///
27 /// Fails on a write error, or if a field exceeds the length its wire format allows.
28 pub fn marshal<W: Write>(&self, _writer: &mut W) -> Result<()> {
29 Ok(())
30 }
31
32 /// Decodes one of these messages from `reader`.
33 ///
34 /// # Errors
35 ///
36 /// Fails if `reader` is truncated or its contents are not a valid encoding.
37 pub fn unmarshal<R: Read>(_reader: &mut R) -> Result<Self> {
38 Ok(HandshakeMessageServerHelloDone {})
39 }
40}