pub struct PasswordAlgorithm(_);
Expand description

The PASSWORD-ALGORITHM attribute is present only in requests. It contains the algorithm that the server must use to derive a key from the long-term password.

Examples

 // Creates a MD5 password algorithm without parameters
 let attr = PasswordAlgorithm::new(Algorithm::from(AlgorithmId::MD5));
 assert_eq!(attr.algorithm(), AlgorithmId::MD5);
 assert_eq!(attr.parameters(), None);

 // Creates a custom password algorithm with parameters
 let params = [0x01, 0x02, 0x03, 0x04, 0x05];
 let algorithm = Algorithm::new(AlgorithmId::Unassigned(255), params.as_ref());
 let attr = PasswordAlgorithm::new(algorithm);
 assert_eq!(attr.algorithm(), AlgorithmId::Unassigned(255));
 assert_eq!(attr.parameters(), Some(params.as_ref()));

Implementations

Creates a new PasswordAlgorithm attribute.

Attributes:
  • algorithm - The Algorithm.
  • value - Specific parameters for the algorithm, if any.

Returns the algorithm

Returns the parameters required by the algorithm.

Trait Implementations

Formats the value using the given formatter. Read more
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Returns the STUN attribute type.
Returns the STUN attribute type of this instance.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.