Skip to main content

nominal_api/conjure/objects/scout/video/api/
ice_server.rs

1/// WebRTC ICE server configuration
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    PartialEq,
8    Eq,
9    PartialOrd,
10    Ord,
11    Hash
12)]
13#[serde(crate = "conjure_object::serde")]
14#[conjure_object::private::staged_builder::staged_builder]
15#[builder(crate = conjure_object::private::staged_builder, update, inline)]
16pub struct IceServer {
17    #[builder(default, list(item(type = String, into)))]
18    #[serde(rename = "urls", skip_serializing_if = "Vec::is_empty", default)]
19    urls: Vec<String>,
20    #[builder(default, into)]
21    #[serde(rename = "username", skip_serializing_if = "Option::is_none", default)]
22    username: Option<String>,
23    #[builder(default, into)]
24    #[serde(rename = "credential", skip_serializing_if = "Option::is_none", default)]
25    credential: Option<String>,
26}
27impl IceServer {
28    /// Constructs a new instance of the type.
29    #[inline]
30    pub fn new() -> Self {
31        Self::builder().build()
32    }
33    #[inline]
34    pub fn urls(&self) -> &[String] {
35        &*self.urls
36    }
37    #[inline]
38    pub fn username(&self) -> Option<&str> {
39        self.username.as_ref().map(|o| &**o)
40    }
41    #[inline]
42    pub fn credential(&self) -> Option<&str> {
43        self.credential.as_ref().map(|o| &**o)
44    }
45}