Struct stun_rs::attributes::stun::Realm
source · 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 PartialEq<&str> for Realm
impl PartialEq<&str> for Realm
source§impl PartialEq<Realm> for &str
impl PartialEq<Realm> for &str
source§impl PartialEq<Realm> for String
impl PartialEq<Realm> for String
source§impl PartialEq<String> for Realm
impl PartialEq<String> for Realm
source§impl PartialEq for Realm
impl PartialEq for Realm
source§impl PartialOrd for Realm
impl PartialOrd for Realm
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§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 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