Enum stun_client::Attribute
source · pub enum Attribute {
MappedAddress,
XORMappedAddress,
Software,
OtherAddress,
ChangeRequest,
ResponseOrigin,
ErrorCode,
Unknown(u16),
}
Expand description
Enum representing STUN attribute
Variants§
MappedAddress
XORMappedAddress
Software
OtherAddress
ChangeRequest
ResponseOrigin
ErrorCode
Unknown(u16)
Implementations§
source§impl Attribute
impl Attribute
sourcepub fn get_mapped_address(message: &Message) -> Option<SocketAddr>
pub fn get_mapped_address(message: &Message) -> Option<SocketAddr>
Gets the value of the MAPPED-ADDRESS attribute from Message.
sourcepub fn get_xor_mapped_address(message: &Message) -> Option<SocketAddr>
pub fn get_xor_mapped_address(message: &Message) -> Option<SocketAddr>
Gets the value of the XOR-MAPPED-ADDRESS attribute from Message.
sourcepub fn get_software(message: &Message) -> Option<String>
pub fn get_software(message: &Message) -> Option<String>
Gets the value of the SOFTWARE attribute from message.
sourcepub fn get_error_code(message: &Message) -> Option<ErrorCode>
pub fn get_error_code(message: &Message) -> Option<ErrorCode>
Gets the value of the ERROR-CODE attribute from Message.
sourcepub fn get_other_address(message: &Message) -> Option<SocketAddr>
pub fn get_other_address(message: &Message) -> Option<SocketAddr>
Gets the value of the OTHER-ADDRESS attribute from Message.
sourcepub fn get_response_origin(message: &Message) -> Option<SocketAddr>
pub fn get_response_origin(message: &Message) -> Option<SocketAddr>
Gets the value of the RESPONSE-ORIGIN attribute from Message.
sourcepub fn generate_change_request_value(
change_ip: bool,
change_port: bool
) -> Vec<u8>
pub fn generate_change_request_value( change_ip: bool, change_port: bool ) -> Vec<u8>
Generates a value for the CHANGE-REQUEST attribute.
pub fn decode_simple_address_attribute( message: &Message, attr: Self ) -> Option<SocketAddr>
Trait Implementations§
source§impl PartialEq<Attribute> for Attribute
impl PartialEq<Attribute> for Attribute
impl Copy for Attribute
impl Eq for Attribute
impl StructuralEq for Attribute
impl StructuralPartialEq for Attribute
Auto Trait Implementations§
impl RefUnwindSafe for Attribute
impl Send for Attribute
impl Sync for Attribute
impl Unpin for Attribute
impl UnwindSafe for Attribute
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