Struct stun_rs::attributes::stun::PasswordAlgorithms
source · pub struct PasswordAlgorithms { /* private fields */ }Expand description
The PasswordAlgorithms attribute may be present in requests and
responses. It contains the list of algorithms that the server can
use to derive the long-term password.
§Examples
// Creates an empty password algorithms attribute
let mut attr = PasswordAlgorithms::default();
assert_eq!(attr.iter().count(), 0);
// Adds a password algorithm attribute
attr.add(PasswordAlgorithm::new(Algorithm::from(AlgorithmId::MD5)));
assert_eq!(attr.iter().count(), 1);Implementations§
source§impl PasswordAlgorithms
impl PasswordAlgorithms
sourcepub fn add(&mut self, algorithm: PasswordAlgorithm)
pub fn add(&mut self, algorithm: PasswordAlgorithm)
Adds a new password algorithm.
sourcepub fn password_algorithms(&self) -> &[PasswordAlgorithm]
pub fn password_algorithms(&self) -> &[PasswordAlgorithm]
Return the array of password attributes
sourcepub fn iter(&self) -> impl Iterator<Item = &PasswordAlgorithm>
pub fn iter(&self) -> impl Iterator<Item = &PasswordAlgorithm>
Returns an iterator over the passwords attributes.
Trait Implementations§
source§impl Debug for PasswordAlgorithms
impl Debug for PasswordAlgorithms
source§impl Default for PasswordAlgorithms
impl Default for PasswordAlgorithms
source§fn default() -> PasswordAlgorithms
fn default() -> PasswordAlgorithms
Returns the “default value” for a type. Read more
source§impl From<PasswordAlgorithms> for StunAttribute
impl From<PasswordAlgorithms> for StunAttribute
source§fn from(value: PasswordAlgorithms) -> Self
fn from(value: PasswordAlgorithms) -> Self
Converts to this type from the input type.
source§impl From<Vec<PasswordAlgorithm>> for PasswordAlgorithms
impl From<Vec<PasswordAlgorithm>> for PasswordAlgorithms
source§fn from(v: Vec<PasswordAlgorithm>) -> Self
fn from(v: Vec<PasswordAlgorithm>) -> Self
Converts to this type from the input type.
source§impl IntoIterator for PasswordAlgorithms
impl IntoIterator for PasswordAlgorithms
§type Item = PasswordAlgorithm
type Item = PasswordAlgorithm
The type of the elements being iterated over.
§type IntoIter = IntoIter<<PasswordAlgorithms as IntoIterator>::Item>
type IntoIter = IntoIter<<PasswordAlgorithms as IntoIterator>::Item>
Which kind of iterator are we turning this into?
source§impl PartialEq for PasswordAlgorithms
impl PartialEq for PasswordAlgorithms
source§fn eq(&self, other: &PasswordAlgorithms) -> bool
fn eq(&self, other: &PasswordAlgorithms) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl StunAttributeType for PasswordAlgorithms
impl StunAttributeType for PasswordAlgorithms
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 PasswordAlgorithms
impl StructuralPartialEq for PasswordAlgorithms
Auto Trait Implementations§
impl RefUnwindSafe for PasswordAlgorithms
impl Send for PasswordAlgorithms
impl Sync for PasswordAlgorithms
impl Unpin for PasswordAlgorithms
impl UnwindSafe for PasswordAlgorithms
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