Struct stun_rs::attributes::stun::Realm
source · pub struct Realm(_);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
sourceimpl From<Realm> for StunAttribute
impl From<Realm> for StunAttribute
sourceimpl Ord for Realm
impl Ord for Realm
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Realm> for Realm
impl PartialOrd<Realm> for Realm
sourcefn partial_cmp(&self, other: &Realm) -> Option<Ordering>
fn partial_cmp(&self, other: &Realm) -> Option<Ordering>
1.0.0 · sourcefn 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 moresourceimpl StunAttributeType for Realm
impl StunAttributeType for Realm
sourcefn get_type() -> AttributeTypewhere
Self: Sized,
fn get_type() -> AttributeTypewhere
Self: Sized,
Returns the STUN attribute type.
sourcefn attribute_type(&self) -> AttributeType
fn attribute_type(&self) -> AttributeType
Returns the STUN attribute type of this instance.
impl Eq for Realm
impl StructuralEq 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more