1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#[cfg(test)]
mod use_candidate_test;
use stun::attributes::ATTR_USE_CANDIDATE;
use stun::message::*;
use util::Error;
#[derive(Default)]
pub struct UseCandidateAttr;
impl Setter for UseCandidateAttr {
fn add_to(&self, m: &mut Message) -> Result<(), Error> {
m.add(ATTR_USE_CANDIDATE, &[]);
Ok(())
}
}
impl UseCandidateAttr {
pub fn new() -> Self {
UseCandidateAttr {}
}
pub fn is_set(m: &Message) -> bool {
let result = m.get(ATTR_USE_CANDIDATE);
result.is_ok()
}
}