improve ws protocol struct naming and documentation

This commit is contained in:
Joakim Frostegård 2023-10-30 19:03:28 +01:00
parent b473bb6fba
commit 0789f7ec3b
17 changed files with 193 additions and 137 deletions

View file

@ -30,10 +30,21 @@ pub struct OfferId(
pub [u8; 20],
);
/// Some kind of nested structure from https://www.npmjs.com/package/simple-peer
/// Nested structure with SDP offer from https://www.npmjs.com/package/simple-peer
///
/// Created using https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/createOffer
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(transparent)]
pub struct JsonValue(pub ::serde_json::Value);
pub struct RtcOffer {
pub sdp: ::serde_json::Value,
}
/// Nested structure with SDP answer from https://www.npmjs.com/package/simple-peer
///
/// Created using https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/createAnswer
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct RtcAnswer {
pub sdp: ::serde_json::Value,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct AnnounceAction;