rsip/common/uri/param/
user.rs

1use rsip_derives::{IntoParam, NewType};
2
3/// Simple NewType around String. Intended to be used for the `user` parameter found in SIP(S)
4/// uris, rarely used nowardays.
5#[derive(NewType, IntoParam, Debug, PartialEq, Eq, Clone)]
6pub struct User(String);
7
8#[cfg(feature = "test-utils")]
9impl testing_utils::Randomize for User {
10    fn random() -> Self {
11        Self(testing_utils::sample(&["phone", "ip", &testing_utils::rand_str_of(5)]).to_string())
12    }
13}