Struct stun_rs::attributes::stun::Nonce
source · pub struct Nonce(/* private fields */);Expand description
The NONCE attribute may be present in requests and responses. It
contains a sequence of qdtext or quoted-pair, which are defined in
RFC3261.
Note that this means that the NONCE attribute will not
contain the actual surrounding quote characters.
§Examples
// Create a nonce attribute using an input string that is
// sequence of `qdtext` or `quoted-pair`
let attr = Nonce::try_from("f//499k954d6OL34oL9FSTvy64sA")?;
assert_eq!(attr, "f//499k954d6OL34oL9FSTvy64sA");
// Next input string is not a valid sequence of `qdtext` or `quoted-pair`
let result = Nonce::try_from("\u{fd}\u{80}");
assert_eq!(result.expect_err("Error expected"), StunErrorType::InvalidParam);Implementations§
Trait Implementations§
source§impl From<Nonce> for StunAttribute
impl From<Nonce> for StunAttribute
source§impl Ord for Nonce
impl Ord for Nonce
source§impl PartialEq<&str> for Nonce
impl PartialEq<&str> for Nonce
source§impl PartialEq<Nonce> for &str
impl PartialEq<Nonce> for &str
source§impl PartialEq<Nonce> for String
impl PartialEq<Nonce> for String
source§impl PartialEq<String> for Nonce
impl PartialEq<String> for Nonce
source§impl PartialEq for Nonce
impl PartialEq for Nonce
source§impl PartialOrd for Nonce
impl PartialOrd for Nonce
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 Nonce
impl StunAttributeType for Nonce
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 Nonce
impl StructuralPartialEq for Nonce
Auto Trait Implementations§
impl RefUnwindSafe for Nonce
impl Send for Nonce
impl Sync for Nonce
impl Unpin for Nonce
impl UnwindSafe for Nonce
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