Skip to content

Commit dfe2363

Browse files
alexipeckrainliu
authored andcommitted
Add Serialize, Deserialize and Hash to RTCIceServer and RTCIceCredentialType
1 parent 3f1c67e commit dfe2363

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

webrtc/src/ice_transport/ice_credential_type.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
use std::fmt;
22

3+
use serde::{Deserialize, Serialize};
4+
35
/// ICECredentialType indicates the type of credentials used to connect to
46
/// an ICE server.
5-
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq)]
7+
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize, Hash)]
68
pub enum RTCIceCredentialType {
79
#[default]
810
Unspecified,

webrtc/src/ice_transport/ice_server.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
use serde::{Deserialize, Serialize};
2+
13
use crate::error::{Error, Result};
24
use crate::ice_transport::ice_credential_type::RTCIceCredentialType;
35

46
/// ICEServer describes a single STUN and TURN server that can be used by
57
/// the ICEAgent to establish a connection with a peer.
6-
#[derive(Default, Debug, Clone)]
8+
#[derive(Default, Debug, Clone, Serialize, Deserialize, Hash)]
79
pub struct RTCIceServer {
810
pub urls: Vec<String>,
911
pub username: String,

0 commit comments

Comments
 (0)