Skip to content

Commit

Permalink
Add Serialize, Deserialize and Hash to RTCIceServer and RTCIceCredent…
Browse files Browse the repository at this point in the history
…ialType
  • Loading branch information
alexipeck authored and rainliu committed Aug 14, 2023
1 parent 3f1c67e commit dfe2363
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion webrtc/src/ice_transport/ice_credential_type.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use std::fmt;

use serde::{Deserialize, Serialize};

/// ICECredentialType indicates the type of credentials used to connect to
/// an ICE server.
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq)]
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize, Hash)]
pub enum RTCIceCredentialType {
#[default]
Unspecified,
Expand Down
4 changes: 3 additions & 1 deletion webrtc/src/ice_transport/ice_server.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
use serde::{Deserialize, Serialize};

use crate::error::{Error, Result};
use crate::ice_transport::ice_credential_type::RTCIceCredentialType;

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

0 comments on commit dfe2363

Please sign in to comment.