pub struct StunMessage { /* private fields */ }
Expand description
The stun message is the basic unit of information interchanged between two agents implementing the STUN protocol.
All STUN messages comprise a 20-byte header followed by zero or more attributes. The STUN header contains a STUN message type, message length, magic cookie, and transaction ID.
STUN messages can be created using the StunMessageBuilder
.
Implementations§
source§impl StunMessage
impl StunMessage
sourcepub fn method(&self) -> MessageMethod
pub fn method(&self) -> MessageMethod
Returns the message method.
sourcepub fn class(&self) -> MessageClass
pub fn class(&self) -> MessageClass
Returns the message class
sourcepub fn transaction_id(&self) -> &TransactionId
pub fn transaction_id(&self) -> &TransactionId
Returns the transaction-id
sourcepub fn attributes(&self) -> &[StunAttribute]
pub fn attributes(&self) -> &[StunAttribute]
Returns the attributes contained in this STUN message.
sourcepub fn get<A>(&self) -> Option<&StunAttribute>where
A: StunAttributeType,
pub fn get<A>(&self) -> Option<&StunAttribute>where
A: StunAttributeType,
Returns the attribute if the message contains the attribute type or None if there is no such attribute. If there are more than one attributes of this type, this function will return the first one.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StunMessage
impl RefUnwindSafe for StunMessage
impl !Send for StunMessage
impl !Sync for StunMessage
impl Unpin for StunMessage
impl UnwindSafe for StunMessage
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