pub struct Realm(/* private fields */);
Expand description
The REALM attribute may be present in requests and responses. It
contains text that meets the grammar for “realm-value” as described
in RFC3261
but without the double quotes and their surrounding
white space. That is, it is an unquoted realm-value (and is therefore
a sequence of qdtext
or quoted-pair).
§Examples
// Create a realm attribute with an input string that meets
// the grammar for `realm-value`
let attr = Realm::try_from("example.org")?;
// Realm uses the OpaqueString profile to compare strings
assert_eq!(attr, "example.org");
// Next input string does not meet the grammar for `realm-value`
let result = Realm::try_from("\u{fd}\u{80}");
assert_eq!(result.expect_err("Error expected"), StunErrorType::InvalidParam);
Implementations§
Trait Implementations§
source§impl From<Realm> for StunAttribute
impl From<Realm> for StunAttribute
source§impl Ord for Realm
impl Ord for Realm
source§impl PartialOrd for Realm
impl PartialOrd for Realm
source§impl StunAttributeType for Realm
impl StunAttributeType for Realm
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 Realm
impl StructuralPartialEq for Realm
Auto Trait Implementations§
impl Freeze for Realm
impl RefUnwindSafe for Realm
impl Send for Realm
impl Sync for Realm
impl Unpin for Realm
impl UnwindSafe for Realm
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
)