pub struct Nonce(_);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
sourceimpl From<Nonce> for StunAttribute
impl From<Nonce> for StunAttribute
sourceimpl Ord for Nonce
impl Ord for Nonce
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<Nonce> for Nonce
impl PartialOrd<Nonce> for Nonce
sourcefn partial_cmp(&self, other: &Nonce) -> Option<Ordering>
fn partial_cmp(&self, other: &Nonce) -> 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 Nonce
impl StunAttributeType for Nonce
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 Nonce
impl StructuralEq 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
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