pub enum StunAttribute {
Show 16 variants Unknown(Unknown), AlternateServer(AlternateServer), ErrorCode(ErrorCode), Fingerprint(Fingerprint), MappedAddress(MappedAddress), MessageIntegrity(MessageIntegrity), MessageIntegritySha256(MessageIntegritySha256), Nonce(Nonce), PasswordAlgorithm(PasswordAlgorithm), PasswordAlgorithms(PasswordAlgorithms), Realm(Realm), Software(Software), UnknownAttributes(UnknownAttributes), UserHash(UserHash), UserName(UserName), XorMappedAddress(XorMappedAddress),
}
Expand description

STUN Attributes that can be attached to a StunMessage

Variants

Unknown(Unknown)

The Unknownatribute

AlternateServer(AlternateServer)

The AlternateServeratribute

ErrorCode(ErrorCode)

The ErrorCodeatribute

Fingerprint(Fingerprint)

The Fingerprintatribute

MappedAddress(MappedAddress)

The MappedAddressatribute

MessageIntegrity(MessageIntegrity)

The MessageIntegrityatribute

MessageIntegritySha256(MessageIntegritySha256)

The MessageIntegritySha256atribute

Nonce(Nonce)

The Nonceatribute

PasswordAlgorithm(PasswordAlgorithm)

The PasswordAlgorithmatribute

PasswordAlgorithms(PasswordAlgorithms)

The PasswordAlgorithmsatribute

Realm(Realm)

The Realmatribute

Software(Software)

The Softwareatribute

UnknownAttributes(UnknownAttributes)

The UnknownAttributesatribute

UserHash(UserHash)

The UserHashatribute

UserName(UserName)

The UserNameatribute

XorMappedAddress(XorMappedAddress)

The XorMappedAddressatribute

Implementations

Returns the STUN attribute type of this instance.

Returns true if this StunAttribute is Unknown

Returns a reference to the internal attribute value or an error if the type of the attribute is not Unknown

Returns a reference to the Unknown attribute.

Panics

Panics if the attribute is not an Unknown

Returns true if this StunAttribute is AlternateServer

Returns a reference to the internal attribute value or an error if the type of the attribute is not AlternateServer

Returns a reference to the AlternateServer attribute.

Panics

Panics if the attribute is not an AlternateServer

Returns true if this StunAttribute is ErrorCode

Returns a reference to the internal attribute value or an error if the type of the attribute is not ErrorCode

Returns a reference to the ErrorCode attribute.

Panics

Panics if the attribute is not an ErrorCode

Returns true if this StunAttribute is Fingerprint

Returns a reference to the internal attribute value or an error if the type of the attribute is not Fingerprint

Returns a reference to the Fingerprint attribute.

Panics

Panics if the attribute is not an Fingerprint

Returns true if this StunAttribute is MappedAddress

Returns a reference to the internal attribute value or an error if the type of the attribute is not MappedAddress

Returns a reference to the MappedAddress attribute.

Panics

Panics if the attribute is not an MappedAddress

Returns true if this StunAttribute is MessageIntegrity

Returns a reference to the internal attribute value or an error if the type of the attribute is not MessageIntegrity

Returns a reference to the MessageIntegrity attribute.

Panics

Panics if the attribute is not an MessageIntegrity

Returns true if this StunAttribute is MessageIntegritySha256

Returns a reference to the internal attribute value or an error if the type of the attribute is not MessageIntegritySha256

Returns a reference to the MessageIntegritySha256 attribute.

Panics

Panics if the attribute is not an MessageIntegritySha256

Returns true if this StunAttribute is Nonce

Returns a reference to the internal attribute value or an error if the type of the attribute is not Nonce

Returns a reference to the Nonce attribute.

Panics

Panics if the attribute is not an Nonce

Returns true if this StunAttribute is PasswordAlgorithm

Returns a reference to the internal attribute value or an error if the type of the attribute is not PasswordAlgorithm

Returns a reference to the PasswordAlgorithm attribute.

Panics

Panics if the attribute is not an PasswordAlgorithm

Returns true if this StunAttribute is PasswordAlgorithms

Returns a reference to the internal attribute value or an error if the type of the attribute is not PasswordAlgorithms

Returns a reference to the PasswordAlgorithms attribute.

Panics

Panics if the attribute is not an PasswordAlgorithms

Returns true if this StunAttribute is Realm

Returns a reference to the internal attribute value or an error if the type of the attribute is not Realm

Returns a reference to the Realm attribute.

Panics

Panics if the attribute is not an Realm

Returns true if this StunAttribute is Software

Returns a reference to the internal attribute value or an error if the type of the attribute is not Software

Returns a reference to the Software attribute.

Panics

Panics if the attribute is not an Software

Returns true if this StunAttribute is UnknownAttributes

Returns a reference to the internal attribute value or an error if the type of the attribute is not UnknownAttributes

Returns a reference to the UnknownAttributes attribute.

Panics

Panics if the attribute is not an UnknownAttributes

Returns true if this StunAttribute is UserHash

Returns a reference to the internal attribute value or an error if the type of the attribute is not UserHash

Returns a reference to the UserHash attribute.

Panics

Panics if the attribute is not an UserHash

Returns true if this StunAttribute is UserName

Returns a reference to the internal attribute value or an error if the type of the attribute is not UserName

Returns a reference to the UserName attribute.

Panics

Panics if the attribute is not an UserName

Returns true if this StunAttribute is XorMappedAddress

Returns a reference to the internal attribute value or an error if the type of the attribute is not XorMappedAddress

Returns a reference to the XorMappedAddress attribute.

Panics

Panics if the attribute is not an XorMappedAddress

Trait Implementations

Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.

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.