Enum iroh_relay::protos::stun::StunAttribute
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§
§impl StunAttribute
impl StunAttribute
pub fn attribute_type(&self) -> AttributeType
pub fn attribute_type(&self) -> AttributeType
Returns the STUN attribute type of this instance.
pub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Returns true if this StunAttribute is Unknown
pub fn as_unknown(&self) -> Result<&Unknown, StunError>
pub fn as_unknown(&self) -> Result<&Unknown, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not Unknown
pub fn expect_unknown(&self) -> &Unknown
pub fn expect_unknown(&self) -> &Unknown
pub fn is_alternate_server(&self) -> bool
pub fn is_alternate_server(&self) -> bool
Returns true if this StunAttribute is AlternateServer
pub fn as_alternate_server(&self) -> Result<&AlternateServer, StunError>
pub fn as_alternate_server(&self) -> Result<&AlternateServer, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not AlternateServer
pub fn expect_alternate_server(&self) -> &AlternateServer
pub fn expect_alternate_server(&self) -> &AlternateServer
Returns a reference to the AlternateServer attribute.
§Panics
Panics if the attribute is not an AlternateServer
pub fn is_error_code(&self) -> bool
pub fn is_error_code(&self) -> bool
Returns true if this StunAttribute is ErrorCode
pub fn as_error_code(&self) -> Result<&ErrorCode, StunError>
pub fn as_error_code(&self) -> Result<&ErrorCode, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not ErrorCode
pub fn expect_error_code(&self) -> &ErrorCode
pub fn expect_error_code(&self) -> &ErrorCode
pub fn is_fingerprint(&self) -> bool
pub fn is_fingerprint(&self) -> bool
Returns true if this StunAttribute is Fingerprint
pub fn as_fingerprint(&self) -> Result<&Fingerprint, StunError>
pub fn as_fingerprint(&self) -> Result<&Fingerprint, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not Fingerprint
pub fn expect_fingerprint(&self) -> &Fingerprint
pub fn expect_fingerprint(&self) -> &Fingerprint
Returns a reference to the Fingerprint attribute.
§Panics
Panics if the attribute is not an Fingerprint
pub fn is_mapped_address(&self) -> bool
pub fn is_mapped_address(&self) -> bool
Returns true if this StunAttribute is MappedAddress
pub fn as_mapped_address(&self) -> Result<&MappedAddress, StunError>
pub fn as_mapped_address(&self) -> Result<&MappedAddress, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not MappedAddress
pub fn expect_mapped_address(&self) -> &MappedAddress
pub fn expect_mapped_address(&self) -> &MappedAddress
Returns a reference to the MappedAddress attribute.
§Panics
Panics if the attribute is not an MappedAddress
pub fn is_message_integrity(&self) -> bool
pub fn is_message_integrity(&self) -> bool
Returns true if this StunAttribute is MessageIntegrity
pub fn as_message_integrity(&self) -> Result<&MessageIntegrity, StunError>
pub fn as_message_integrity(&self) -> Result<&MessageIntegrity, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not MessageIntegrity
pub fn expect_message_integrity(&self) -> &MessageIntegrity
pub fn expect_message_integrity(&self) -> &MessageIntegrity
Returns a reference to the MessageIntegrity attribute.
§Panics
Panics if the attribute is not an MessageIntegrity
pub fn is_message_integrity_sha256(&self) -> bool
pub fn is_message_integrity_sha256(&self) -> bool
Returns true if this StunAttribute is MessageIntegritySha256
pub fn as_message_integrity_sha256(
&self
) -> Result<&MessageIntegritySha256, StunError>
pub fn as_message_integrity_sha256( &self ) -> Result<&MessageIntegritySha256, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not MessageIntegritySha256
pub fn expect_message_integrity_sha256(&self) -> &MessageIntegritySha256
pub fn expect_message_integrity_sha256(&self) -> &MessageIntegritySha256
Returns a reference to the MessageIntegritySha256 attribute.
§Panics
Panics if the attribute is not an MessageIntegritySha256
pub fn as_nonce(&self) -> Result<&Nonce, StunError>
pub fn as_nonce(&self) -> Result<&Nonce, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not Nonce
pub fn expect_nonce(&self) -> &Nonce
pub fn expect_nonce(&self) -> &Nonce
pub fn is_password_algorithm(&self) -> bool
pub fn is_password_algorithm(&self) -> bool
Returns true if this StunAttribute is PasswordAlgorithm
pub fn as_password_algorithm(&self) -> Result<&PasswordAlgorithm, StunError>
pub fn as_password_algorithm(&self) -> Result<&PasswordAlgorithm, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not PasswordAlgorithm
pub fn expect_password_algorithm(&self) -> &PasswordAlgorithm
pub fn expect_password_algorithm(&self) -> &PasswordAlgorithm
Returns a reference to the PasswordAlgorithm attribute.
§Panics
Panics if the attribute is not an PasswordAlgorithm
pub fn is_password_algorithms(&self) -> bool
pub fn is_password_algorithms(&self) -> bool
Returns true if this StunAttribute is PasswordAlgorithms
pub fn as_password_algorithms(&self) -> Result<&PasswordAlgorithms, StunError>
pub fn as_password_algorithms(&self) -> Result<&PasswordAlgorithms, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not PasswordAlgorithms
pub fn expect_password_algorithms(&self) -> &PasswordAlgorithms
pub fn expect_password_algorithms(&self) -> &PasswordAlgorithms
Returns a reference to the PasswordAlgorithms attribute.
§Panics
Panics if the attribute is not an PasswordAlgorithms
pub fn as_realm(&self) -> Result<&Realm, StunError>
pub fn as_realm(&self) -> Result<&Realm, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not Realm
pub fn expect_realm(&self) -> &Realm
pub fn expect_realm(&self) -> &Realm
pub fn is_software(&self) -> bool
pub fn is_software(&self) -> bool
Returns true if this StunAttribute is Software
pub fn as_software(&self) -> Result<&Software, StunError>
pub fn as_software(&self) -> Result<&Software, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not Software
pub fn expect_software(&self) -> &Software
pub fn expect_software(&self) -> &Software
pub fn is_unknown_attributes(&self) -> bool
pub fn is_unknown_attributes(&self) -> bool
Returns true if this StunAttribute is UnknownAttributes
pub fn as_unknown_attributes(&self) -> Result<&UnknownAttributes, StunError>
pub fn as_unknown_attributes(&self) -> Result<&UnknownAttributes, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not UnknownAttributes
pub fn expect_unknown_attributes(&self) -> &UnknownAttributes
pub fn expect_unknown_attributes(&self) -> &UnknownAttributes
Returns a reference to the UnknownAttributes attribute.
§Panics
Panics if the attribute is not an UnknownAttributes
pub fn is_user_hash(&self) -> bool
pub fn is_user_hash(&self) -> bool
Returns true if this StunAttribute is UserHash
pub fn as_user_hash(&self) -> Result<&UserHash, StunError>
pub fn as_user_hash(&self) -> Result<&UserHash, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not UserHash
pub fn expect_user_hash(&self) -> &UserHash
pub fn expect_user_hash(&self) -> &UserHash
pub fn is_user_name(&self) -> bool
pub fn is_user_name(&self) -> bool
Returns true if this StunAttribute is UserName
pub fn as_user_name(&self) -> Result<&UserName, StunError>
pub fn as_user_name(&self) -> Result<&UserName, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not UserName
pub fn expect_user_name(&self) -> &UserName
pub fn expect_user_name(&self) -> &UserName
pub fn is_xor_mapped_address(&self) -> bool
pub fn is_xor_mapped_address(&self) -> bool
Returns true if this StunAttribute is XorMappedAddress
pub fn as_xor_mapped_address(&self) -> Result<&XorMappedAddress, StunError>
pub fn as_xor_mapped_address(&self) -> Result<&XorMappedAddress, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not XorMappedAddress
pub fn expect_xor_mapped_address(&self) -> &XorMappedAddress
pub fn expect_xor_mapped_address(&self) -> &XorMappedAddress
Returns a reference to the XorMappedAddress attribute.
§Panics
Panics if the attribute is not an XorMappedAddress
Trait Implementations§
§impl Clone for StunAttribute
impl Clone for StunAttribute
§fn clone(&self) -> StunAttribute
fn clone(&self) -> StunAttribute
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more