pub struct UserName(/* private fields */);
Expand description
The USER-NAME attribute is used for message integrity. It identifies
the user name and password combination used in the message-integrity check.
It MUST contain a UTF-8-encoded RFC3629
sequence of fewer than 509 bytes and MUST have been processed using
the OpaqueString
profile RFC8265
§Examples
let user_name = UserName::try_from("username")?;
// UserName uses the OpaqueString profie to compare strings
assert_eq!(user_name, "username");
// Control characters like TAB `U+0009` are disallowed by OpaqueString profile
let result = UserName::try_from("user\u{0009}name");
assert_eq!(result.expect_err("Error expected"), StunErrorType::InvalidParam);
Implementations§
Trait Implementations§
source§impl From<UserName> for StunAttribute
impl From<UserName> for StunAttribute
source§impl StunAttributeType for UserName
impl StunAttributeType for UserName
source§fn get_type() -> AttributeTypewhere
Self: Sized,
fn get_type() -> AttributeTypewhere
Self: Sized,
Returns the STUN attribute type.
source§fn attribute_type(&self) -> AttributeType
fn attribute_type(&self) -> AttributeType
Returns the STUN attribute type of this instance.
impl Eq for UserName
impl StructuralPartialEq for UserName
Auto Trait Implementations§
impl Freeze for UserName
impl RefUnwindSafe for UserName
impl Send for UserName
impl Sync for UserName
impl Unpin for UserName
impl UnwindSafe for UserName
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)