pub enum StunAttribute {
Show 39 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),
IceControlled(IceControlled),
IceControlling(IceControlling),
Priority(Priority),
UseCandidate(UseCandidate),
ChannelNumber(ChannelNumber),
LifeTime(LifeTime),
XorPeerAddress(XorPeerAddress),
XorRelayedAddress(XorRelayedAddress),
Data(Data),
RequestedAddressFamily(RequestedAddressFamily),
EvenPort(EvenPort),
DontFragment(DontFragment),
RequestedTrasport(RequestedTrasport),
AdditionalAddressFamily(AdditionalAddressFamily),
ReservationToken(ReservationToken),
AddressErrorCode(AddressErrorCode),
Icmp(Icmp),
MobilityTicket(MobilityTicket),
ChangeRequest(ChangeRequest),
OtherAddress(OtherAddress),
Padding(Padding),
ResponseOrigin(ResponseOrigin),
ResponsePort(ResponsePort),
}
Expand description
STUN Attributes that can be attached to a StunMessage
Variants§
Unknown(Unknown)
The Unknown
atribute
AlternateServer(AlternateServer)
The AlternateServer
atribute
ErrorCode(ErrorCode)
The ErrorCode
atribute
Fingerprint(Fingerprint)
The Fingerprint
atribute
MappedAddress(MappedAddress)
The MappedAddress
atribute
MessageIntegrity(MessageIntegrity)
The MessageIntegrity
atribute
MessageIntegritySha256(MessageIntegritySha256)
The MessageIntegritySha256
atribute
Nonce(Nonce)
The Nonce
atribute
PasswordAlgorithm(PasswordAlgorithm)
The PasswordAlgorithm
atribute
PasswordAlgorithms(PasswordAlgorithms)
The PasswordAlgorithms
atribute
Realm(Realm)
The Realm
atribute
Software(Software)
The Software
atribute
UnknownAttributes(UnknownAttributes)
The UnknownAttributes
atribute
UserHash(UserHash)
The UserHash
atribute
UserName(UserName)
The UserName
atribute
XorMappedAddress(XorMappedAddress)
The XorMappedAddress
atribute
IceControlled(IceControlled)
The IceControlled
atribute
IceControlling(IceControlling)
The IceControlling
atribute
Priority(Priority)
The Priority
atribute
UseCandidate(UseCandidate)
The UseCandidate
atribute
ChannelNumber(ChannelNumber)
The ChannelNumber
atribute
LifeTime(LifeTime)
The LifeTime
atribute
XorPeerAddress(XorPeerAddress)
The XorPeerAddress
atribute
XorRelayedAddress(XorRelayedAddress)
The XorRelayedAddress
atribute
Data(Data)
The Data
atribute
RequestedAddressFamily(RequestedAddressFamily)
The RequestedAddressFamily
atribute
EvenPort(EvenPort)
The EvenPort
atribute
DontFragment(DontFragment)
The DontFragment
atribute
RequestedTrasport(RequestedTrasport)
The RequestedTrasport
atribute
AdditionalAddressFamily(AdditionalAddressFamily)
The AdditionalAddressFamily
atribute
ReservationToken(ReservationToken)
The ReservationToken
atribute
AddressErrorCode(AddressErrorCode)
The AddressErrorCode
atribute
Icmp(Icmp)
The Icmp
atribute
MobilityTicket(MobilityTicket)
The MobilityTicket
atribute
ChangeRequest(ChangeRequest)
The ChangeRequest
atribute
OtherAddress(OtherAddress)
The OtherAddress
atribute
Padding(Padding)
The Padding
atribute
ResponseOrigin(ResponseOrigin)
The ResponseOrigin
atribute
ResponsePort(ResponsePort)
The ResponsePort
atribute
Implementations§
source§impl StunAttribute
impl StunAttribute
sourcepub fn attribute_type(&self) -> AttributeType
pub fn attribute_type(&self) -> AttributeType
Returns the STUN attribute type of this instance.
sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Returns true if this StunAttribute
is Unknown
sourcepub 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
sourcepub fn expect_unknown(&self) -> &Unknown
pub fn expect_unknown(&self) -> &Unknown
sourcepub fn is_alternate_server(&self) -> bool
pub fn is_alternate_server(&self) -> bool
Returns true if this StunAttribute
is AlternateServer
sourcepub 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
sourcepub 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
sourcepub fn is_error_code(&self) -> bool
pub fn is_error_code(&self) -> bool
Returns true if this StunAttribute
is ErrorCode
sourcepub 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
sourcepub fn expect_error_code(&self) -> &ErrorCode
pub fn expect_error_code(&self) -> &ErrorCode
sourcepub fn is_fingerprint(&self) -> bool
pub fn is_fingerprint(&self) -> bool
Returns true if this StunAttribute
is Fingerprint
sourcepub 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
sourcepub 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
sourcepub fn is_mapped_address(&self) -> bool
pub fn is_mapped_address(&self) -> bool
Returns true if this StunAttribute
is MappedAddress
sourcepub 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
sourcepub 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
sourcepub fn is_message_integrity(&self) -> bool
pub fn is_message_integrity(&self) -> bool
Returns true if this StunAttribute
is MessageIntegrity
sourcepub 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
sourcepub 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
sourcepub fn is_message_integrity_sha256(&self) -> bool
pub fn is_message_integrity_sha256(&self) -> bool
Returns true if this StunAttribute
is MessageIntegritySha256
sourcepub 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
sourcepub 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
sourcepub 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
sourcepub fn expect_nonce(&self) -> &Nonce
pub fn expect_nonce(&self) -> &Nonce
sourcepub fn is_password_algorithm(&self) -> bool
pub fn is_password_algorithm(&self) -> bool
Returns true if this StunAttribute
is PasswordAlgorithm
sourcepub 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
sourcepub 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
sourcepub fn is_password_algorithms(&self) -> bool
pub fn is_password_algorithms(&self) -> bool
Returns true if this StunAttribute
is PasswordAlgorithms
sourcepub 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
sourcepub 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
sourcepub 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
sourcepub fn expect_realm(&self) -> &Realm
pub fn expect_realm(&self) -> &Realm
sourcepub fn is_software(&self) -> bool
pub fn is_software(&self) -> bool
Returns true if this StunAttribute
is Software
sourcepub 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
sourcepub fn expect_software(&self) -> &Software
pub fn expect_software(&self) -> &Software
sourcepub fn is_unknown_attributes(&self) -> bool
pub fn is_unknown_attributes(&self) -> bool
Returns true if this StunAttribute
is UnknownAttributes
sourcepub 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
sourcepub 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
sourcepub fn is_user_hash(&self) -> bool
pub fn is_user_hash(&self) -> bool
Returns true if this StunAttribute
is UserHash
sourcepub 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
sourcepub fn expect_user_hash(&self) -> &UserHash
pub fn expect_user_hash(&self) -> &UserHash
sourcepub fn is_user_name(&self) -> bool
pub fn is_user_name(&self) -> bool
Returns true if this StunAttribute
is UserName
sourcepub 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
sourcepub fn expect_user_name(&self) -> &UserName
pub fn expect_user_name(&self) -> &UserName
sourcepub fn is_xor_mapped_address(&self) -> bool
pub fn is_xor_mapped_address(&self) -> bool
Returns true if this StunAttribute
is XorMappedAddress
sourcepub 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
sourcepub 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
sourcepub fn is_ice_controlled(&self) -> bool
pub fn is_ice_controlled(&self) -> bool
Returns true if this StunAttribute
is IceControlled
sourcepub fn as_ice_controlled(&self) -> Result<&IceControlled, StunError>
pub fn as_ice_controlled(&self) -> Result<&IceControlled, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not IceControlled
sourcepub fn expect_ice_controlled(&self) -> &IceControlled
pub fn expect_ice_controlled(&self) -> &IceControlled
Returns a reference to the IceControlled
attribute.
§Panics
Panics if the attribute is not an IceControlled
sourcepub fn is_ice_controlling(&self) -> bool
pub fn is_ice_controlling(&self) -> bool
Returns true if this StunAttribute
is IceControlling
sourcepub fn as_ice_controlling(&self) -> Result<&IceControlling, StunError>
pub fn as_ice_controlling(&self) -> Result<&IceControlling, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not IceControlling
sourcepub fn expect_ice_controlling(&self) -> &IceControlling
pub fn expect_ice_controlling(&self) -> &IceControlling
Returns a reference to the IceControlling
attribute.
§Panics
Panics if the attribute is not an IceControlling
sourcepub fn is_priority(&self) -> bool
pub fn is_priority(&self) -> bool
Returns true if this StunAttribute
is Priority
sourcepub fn as_priority(&self) -> Result<&Priority, StunError>
pub fn as_priority(&self) -> Result<&Priority, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not Priority
sourcepub fn expect_priority(&self) -> &Priority
pub fn expect_priority(&self) -> &Priority
sourcepub fn is_use_candidate(&self) -> bool
pub fn is_use_candidate(&self) -> bool
Returns true if this StunAttribute
is UseCandidate
sourcepub fn as_use_candidate(&self) -> Result<&UseCandidate, StunError>
pub fn as_use_candidate(&self) -> Result<&UseCandidate, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not UseCandidate
sourcepub fn expect_use_candidate(&self) -> &UseCandidate
pub fn expect_use_candidate(&self) -> &UseCandidate
Returns a reference to the UseCandidate
attribute.
§Panics
Panics if the attribute is not an UseCandidate
sourcepub fn is_channel_number(&self) -> bool
pub fn is_channel_number(&self) -> bool
Returns true if this StunAttribute
is ChannelNumber
sourcepub fn as_channel_number(&self) -> Result<&ChannelNumber, StunError>
pub fn as_channel_number(&self) -> Result<&ChannelNumber, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not ChannelNumber
sourcepub fn expect_channel_number(&self) -> &ChannelNumber
pub fn expect_channel_number(&self) -> &ChannelNumber
Returns a reference to the ChannelNumber
attribute.
§Panics
Panics if the attribute is not an ChannelNumber
sourcepub fn is_life_time(&self) -> bool
pub fn is_life_time(&self) -> bool
Returns true if this StunAttribute
is LifeTime
sourcepub fn as_life_time(&self) -> Result<&LifeTime, StunError>
pub fn as_life_time(&self) -> Result<&LifeTime, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not LifeTime
sourcepub fn expect_life_time(&self) -> &LifeTime
pub fn expect_life_time(&self) -> &LifeTime
sourcepub fn is_xor_peer_address(&self) -> bool
pub fn is_xor_peer_address(&self) -> bool
Returns true if this StunAttribute
is XorPeerAddress
sourcepub fn as_xor_peer_address(&self) -> Result<&XorPeerAddress, StunError>
pub fn as_xor_peer_address(&self) -> Result<&XorPeerAddress, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not XorPeerAddress
sourcepub fn expect_xor_peer_address(&self) -> &XorPeerAddress
pub fn expect_xor_peer_address(&self) -> &XorPeerAddress
Returns a reference to the XorPeerAddress
attribute.
§Panics
Panics if the attribute is not an XorPeerAddress
sourcepub fn is_xor_relayed_address(&self) -> bool
pub fn is_xor_relayed_address(&self) -> bool
Returns true if this StunAttribute
is XorRelayedAddress
sourcepub fn as_xor_relayed_address(&self) -> Result<&XorRelayedAddress, StunError>
pub fn as_xor_relayed_address(&self) -> Result<&XorRelayedAddress, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not XorRelayedAddress
sourcepub fn expect_xor_relayed_address(&self) -> &XorRelayedAddress
pub fn expect_xor_relayed_address(&self) -> &XorRelayedAddress
Returns a reference to the XorRelayedAddress
attribute.
§Panics
Panics if the attribute is not an XorRelayedAddress
sourcepub fn as_data(&self) -> Result<&Data, StunError>
pub fn as_data(&self) -> Result<&Data, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not Data
sourcepub fn expect_data(&self) -> &Data
pub fn expect_data(&self) -> &Data
sourcepub fn is_requested_address_family(&self) -> bool
pub fn is_requested_address_family(&self) -> bool
Returns true if this StunAttribute
is RequestedAddressFamily
sourcepub fn as_requested_address_family(
&self,
) -> Result<&RequestedAddressFamily, StunError>
pub fn as_requested_address_family( &self, ) -> Result<&RequestedAddressFamily, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not RequestedAddressFamily
sourcepub fn expect_requested_address_family(&self) -> &RequestedAddressFamily
pub fn expect_requested_address_family(&self) -> &RequestedAddressFamily
Returns a reference to the RequestedAddressFamily
attribute.
§Panics
Panics if the attribute is not an RequestedAddressFamily
sourcepub fn is_even_port(&self) -> bool
pub fn is_even_port(&self) -> bool
Returns true if this StunAttribute
is EvenPort
sourcepub fn as_even_port(&self) -> Result<&EvenPort, StunError>
pub fn as_even_port(&self) -> Result<&EvenPort, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not EvenPort
sourcepub fn expect_even_port(&self) -> &EvenPort
pub fn expect_even_port(&self) -> &EvenPort
sourcepub fn is_dont_fragment(&self) -> bool
pub fn is_dont_fragment(&self) -> bool
Returns true if this StunAttribute
is DontFragment
sourcepub fn as_dont_fragment(&self) -> Result<&DontFragment, StunError>
pub fn as_dont_fragment(&self) -> Result<&DontFragment, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not DontFragment
sourcepub fn expect_dont_fragment(&self) -> &DontFragment
pub fn expect_dont_fragment(&self) -> &DontFragment
Returns a reference to the DontFragment
attribute.
§Panics
Panics if the attribute is not an DontFragment
sourcepub fn is_requested_trasport(&self) -> bool
pub fn is_requested_trasport(&self) -> bool
Returns true if this StunAttribute
is RequestedTrasport
sourcepub fn as_requested_trasport(&self) -> Result<&RequestedTrasport, StunError>
pub fn as_requested_trasport(&self) -> Result<&RequestedTrasport, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not RequestedTrasport
sourcepub fn expect_requested_trasport(&self) -> &RequestedTrasport
pub fn expect_requested_trasport(&self) -> &RequestedTrasport
Returns a reference to the RequestedTrasport
attribute.
§Panics
Panics if the attribute is not an RequestedTrasport
sourcepub fn is_additional_address_family(&self) -> bool
pub fn is_additional_address_family(&self) -> bool
Returns true if this StunAttribute
is AdditionalAddressFamily
sourcepub fn as_additional_address_family(
&self,
) -> Result<&AdditionalAddressFamily, StunError>
pub fn as_additional_address_family( &self, ) -> Result<&AdditionalAddressFamily, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not AdditionalAddressFamily
sourcepub fn expect_additional_address_family(&self) -> &AdditionalAddressFamily
pub fn expect_additional_address_family(&self) -> &AdditionalAddressFamily
Returns a reference to the AdditionalAddressFamily
attribute.
§Panics
Panics if the attribute is not an AdditionalAddressFamily
sourcepub fn is_reservation_token(&self) -> bool
pub fn is_reservation_token(&self) -> bool
Returns true if this StunAttribute
is ReservationToken
sourcepub fn as_reservation_token(&self) -> Result<&ReservationToken, StunError>
pub fn as_reservation_token(&self) -> Result<&ReservationToken, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not ReservationToken
sourcepub fn expect_reservation_token(&self) -> &ReservationToken
pub fn expect_reservation_token(&self) -> &ReservationToken
Returns a reference to the ReservationToken
attribute.
§Panics
Panics if the attribute is not an ReservationToken
sourcepub fn is_address_error_code(&self) -> bool
pub fn is_address_error_code(&self) -> bool
Returns true if this StunAttribute
is AddressErrorCode
sourcepub fn as_address_error_code(&self) -> Result<&AddressErrorCode, StunError>
pub fn as_address_error_code(&self) -> Result<&AddressErrorCode, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not AddressErrorCode
sourcepub fn expect_address_error_code(&self) -> &AddressErrorCode
pub fn expect_address_error_code(&self) -> &AddressErrorCode
Returns a reference to the AddressErrorCode
attribute.
§Panics
Panics if the attribute is not an AddressErrorCode
sourcepub fn as_icmp(&self) -> Result<&Icmp, StunError>
pub fn as_icmp(&self) -> Result<&Icmp, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not Icmp
sourcepub fn expect_icmp(&self) -> &Icmp
pub fn expect_icmp(&self) -> &Icmp
sourcepub fn is_mobility_ticket(&self) -> bool
pub fn is_mobility_ticket(&self) -> bool
Returns true if this StunAttribute
is MobilityTicket
sourcepub fn as_mobility_ticket(&self) -> Result<&MobilityTicket, StunError>
pub fn as_mobility_ticket(&self) -> Result<&MobilityTicket, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not MobilityTicket
sourcepub fn expect_mobility_ticket(&self) -> &MobilityTicket
pub fn expect_mobility_ticket(&self) -> &MobilityTicket
Returns a reference to the MobilityTicket
attribute.
§Panics
Panics if the attribute is not an MobilityTicket
sourcepub fn is_change_request(&self) -> bool
pub fn is_change_request(&self) -> bool
Returns true if this StunAttribute
is ChangeRequest
sourcepub fn as_change_request(&self) -> Result<&ChangeRequest, StunError>
pub fn as_change_request(&self) -> Result<&ChangeRequest, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not ChangeRequest
sourcepub fn expect_change_request(&self) -> &ChangeRequest
pub fn expect_change_request(&self) -> &ChangeRequest
Returns a reference to the ChangeRequest
attribute.
§Panics
Panics if the attribute is not an ChangeRequest
sourcepub fn is_other_address(&self) -> bool
pub fn is_other_address(&self) -> bool
Returns true if this StunAttribute
is OtherAddress
sourcepub fn as_other_address(&self) -> Result<&OtherAddress, StunError>
pub fn as_other_address(&self) -> Result<&OtherAddress, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not OtherAddress
sourcepub fn expect_other_address(&self) -> &OtherAddress
pub fn expect_other_address(&self) -> &OtherAddress
Returns a reference to the OtherAddress
attribute.
§Panics
Panics if the attribute is not an OtherAddress
sourcepub fn is_padding(&self) -> bool
pub fn is_padding(&self) -> bool
Returns true if this StunAttribute
is Padding
sourcepub fn as_padding(&self) -> Result<&Padding, StunError>
pub fn as_padding(&self) -> Result<&Padding, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not Padding
sourcepub fn expect_padding(&self) -> &Padding
pub fn expect_padding(&self) -> &Padding
sourcepub fn is_response_origin(&self) -> bool
pub fn is_response_origin(&self) -> bool
Returns true if this StunAttribute
is ResponseOrigin
sourcepub fn as_response_origin(&self) -> Result<&ResponseOrigin, StunError>
pub fn as_response_origin(&self) -> Result<&ResponseOrigin, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not ResponseOrigin
sourcepub fn expect_response_origin(&self) -> &ResponseOrigin
pub fn expect_response_origin(&self) -> &ResponseOrigin
Returns a reference to the ResponseOrigin
attribute.
§Panics
Panics if the attribute is not an ResponseOrigin
sourcepub fn is_response_port(&self) -> bool
pub fn is_response_port(&self) -> bool
Returns true if this StunAttribute
is ResponsePort
sourcepub fn as_response_port(&self) -> Result<&ResponsePort, StunError>
pub fn as_response_port(&self) -> Result<&ResponsePort, StunError>
Returns a reference to the internal attribute value or an error if the type of the attribute is not ResponsePort
sourcepub fn expect_response_port(&self) -> &ResponsePort
pub fn expect_response_port(&self) -> &ResponsePort
Returns a reference to the ResponsePort
attribute.
§Panics
Panics if the attribute is not an ResponsePort
Trait Implementations§
source§impl Clone for StunAttribute
impl Clone for StunAttribute
source§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 moresource§impl Debug for StunAttribute
impl Debug for StunAttribute
source§impl From<AdditionalAddressFamily> for StunAttribute
impl From<AdditionalAddressFamily> for StunAttribute
source§fn from(value: AdditionalAddressFamily) -> Self
fn from(value: AdditionalAddressFamily) -> Self
source§impl From<AddressErrorCode> for StunAttribute
impl From<AddressErrorCode> for StunAttribute
source§fn from(value: AddressErrorCode) -> Self
fn from(value: AddressErrorCode) -> Self
source§impl From<AlternateServer> for StunAttribute
impl From<AlternateServer> for StunAttribute
source§fn from(value: AlternateServer) -> Self
fn from(value: AlternateServer) -> Self
source§impl From<ChangeRequest> for StunAttribute
impl From<ChangeRequest> for StunAttribute
source§fn from(value: ChangeRequest) -> Self
fn from(value: ChangeRequest) -> Self
source§impl From<ChannelNumber> for StunAttribute
impl From<ChannelNumber> for StunAttribute
source§fn from(value: ChannelNumber) -> Self
fn from(value: ChannelNumber) -> Self
source§impl From<Data> for StunAttribute
impl From<Data> for StunAttribute
source§impl From<DontFragment> for StunAttribute
impl From<DontFragment> for StunAttribute
source§fn from(value: DontFragment) -> Self
fn from(value: DontFragment) -> Self
source§impl From<ErrorCode> for StunAttribute
impl From<ErrorCode> for StunAttribute
source§impl From<EvenPort> for StunAttribute
impl From<EvenPort> for StunAttribute
source§impl From<Fingerprint> for StunAttribute
impl From<Fingerprint> for StunAttribute
source§fn from(value: Fingerprint) -> Self
fn from(value: Fingerprint) -> Self
source§impl From<IceControlled> for StunAttribute
impl From<IceControlled> for StunAttribute
source§fn from(value: IceControlled) -> Self
fn from(value: IceControlled) -> Self
source§impl From<IceControlling> for StunAttribute
impl From<IceControlling> for StunAttribute
source§fn from(value: IceControlling) -> Self
fn from(value: IceControlling) -> Self
source§impl From<Icmp> for StunAttribute
impl From<Icmp> for StunAttribute
source§impl From<LifeTime> for StunAttribute
impl From<LifeTime> for StunAttribute
source§impl From<MappedAddress> for StunAttribute
impl From<MappedAddress> for StunAttribute
source§fn from(value: MappedAddress) -> Self
fn from(value: MappedAddress) -> Self
source§impl From<MessageIntegrity> for StunAttribute
impl From<MessageIntegrity> for StunAttribute
source§fn from(value: MessageIntegrity) -> Self
fn from(value: MessageIntegrity) -> Self
source§impl From<MessageIntegritySha256> for StunAttribute
impl From<MessageIntegritySha256> for StunAttribute
source§fn from(value: MessageIntegritySha256) -> Self
fn from(value: MessageIntegritySha256) -> Self
source§impl From<MobilityTicket> for StunAttribute
impl From<MobilityTicket> for StunAttribute
source§fn from(value: MobilityTicket) -> Self
fn from(value: MobilityTicket) -> Self
source§impl From<Nonce> for StunAttribute
impl From<Nonce> for StunAttribute
source§impl From<OtherAddress> for StunAttribute
impl From<OtherAddress> for StunAttribute
source§fn from(value: OtherAddress) -> Self
fn from(value: OtherAddress) -> Self
source§impl From<Padding> for StunAttribute
impl From<Padding> for StunAttribute
source§impl From<PasswordAlgorithm> for StunAttribute
impl From<PasswordAlgorithm> for StunAttribute
source§fn from(value: PasswordAlgorithm) -> Self
fn from(value: PasswordAlgorithm) -> Self
source§impl From<PasswordAlgorithms> for StunAttribute
impl From<PasswordAlgorithms> for StunAttribute
source§fn from(value: PasswordAlgorithms) -> Self
fn from(value: PasswordAlgorithms) -> Self
source§impl From<Priority> for StunAttribute
impl From<Priority> for StunAttribute
source§impl From<Realm> for StunAttribute
impl From<Realm> for StunAttribute
source§impl From<RequestedAddressFamily> for StunAttribute
impl From<RequestedAddressFamily> for StunAttribute
source§fn from(value: RequestedAddressFamily) -> Self
fn from(value: RequestedAddressFamily) -> Self
source§impl From<RequestedTrasport> for StunAttribute
impl From<RequestedTrasport> for StunAttribute
source§fn from(value: RequestedTrasport) -> Self
fn from(value: RequestedTrasport) -> Self
source§impl From<ReservationToken> for StunAttribute
impl From<ReservationToken> for StunAttribute
source§fn from(value: ReservationToken) -> Self
fn from(value: ReservationToken) -> Self
source§impl From<ResponseOrigin> for StunAttribute
impl From<ResponseOrigin> for StunAttribute
source§fn from(value: ResponseOrigin) -> Self
fn from(value: ResponseOrigin) -> Self
source§impl From<ResponsePort> for StunAttribute
impl From<ResponsePort> for StunAttribute
source§fn from(value: ResponsePort) -> Self
fn from(value: ResponsePort) -> Self
source§impl From<Software> for StunAttribute
impl From<Software> for StunAttribute
source§impl From<Unknown> for StunAttribute
impl From<Unknown> for StunAttribute
source§impl From<UnknownAttributes> for StunAttribute
impl From<UnknownAttributes> for StunAttribute
source§fn from(value: UnknownAttributes) -> Self
fn from(value: UnknownAttributes) -> Self
source§impl From<UseCandidate> for StunAttribute
impl From<UseCandidate> for StunAttribute
source§fn from(value: UseCandidate) -> Self
fn from(value: UseCandidate) -> Self
source§impl From<UserHash> for StunAttribute
impl From<UserHash> for StunAttribute
source§impl From<UserName> for StunAttribute
impl From<UserName> for StunAttribute
source§impl From<XorMappedAddress> for StunAttribute
impl From<XorMappedAddress> for StunAttribute
source§fn from(value: XorMappedAddress) -> Self
fn from(value: XorMappedAddress) -> Self
source§impl From<XorPeerAddress> for StunAttribute
impl From<XorPeerAddress> for StunAttribute
source§fn from(value: XorPeerAddress) -> Self
fn from(value: XorPeerAddress) -> Self
source§impl From<XorRelayedAddress> for StunAttribute
impl From<XorRelayedAddress> for StunAttribute
source§fn from(value: XorRelayedAddress) -> Self
fn from(value: XorRelayedAddress) -> Self
Auto Trait Implementations§
impl Freeze for StunAttribute
impl RefUnwindSafe for StunAttribute
impl !Send for StunAttribute
impl !Sync for StunAttribute
impl Unpin for StunAttribute
impl UnwindSafe for StunAttribute
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)