pub struct Message { /* private fields */ }Expand description
STUN message.
Implementations§
Source§impl Message
impl Message
Sourcepub fn from_frame(frame: Bytes) -> Result<Self, InvalidMessage>
pub fn from_frame(frame: Bytes) -> Result<Self, InvalidMessage>
Parse a STUN message from a given frame.
Sourcepub fn is_rfc5389_message(&self) -> bool
pub fn is_rfc5389_message(&self) -> bool
Check if this is a STUN message as defined in RFC 5389.
Sourcepub fn is_request(&self) -> bool
pub fn is_request(&self) -> bool
Check if this is a STUN request.
Sourcepub fn is_response(&self) -> bool
pub fn is_response(&self) -> bool
Check if this is a STUN response.
Sourcepub fn class(&self) -> MessageClass
pub fn class(&self) -> MessageClass
Get the message class.
Get value of the magic cookie as defined in RFC 5389.
Sourcepub fn transaction_id(&self) -> [u8; 12]
pub fn transaction_id(&self) -> [u8; 12]
Get the transaction ID as defined in RFC 5389.
Sourcepub fn long_transaction_id(&self) -> [u8; 16]
pub fn long_transaction_id(&self) -> [u8; 16]
Get the transaction ID as defined in RFC 3489.
Sourcepub fn attributes(&self) -> &Attributes
pub fn attributes(&self) -> &Attributes
Get message attributes.
Sourcepub fn unknown_attributes(&self) -> &[u16]
pub fn unknown_attributes(&self) -> &[u16]
Get types of unknown attributes.
§Note
This is not a value of the unknown attributes attribute. These are the attributes that we actually weren’t able to parse.
Sourcepub fn check_fingerprint(&self) -> bool
pub fn check_fingerprint(&self) -> bool
Check the message fingerprint.
The method return true only if the fingerprint attribute exists and
the value of the fingerprint is correct.
Sourcepub fn check_st_credentials(&self, key: &[u8]) -> Result<(), IntegrityError>
pub fn check_st_credentials(&self, key: &[u8]) -> Result<(), IntegrityError>
Check short-term credentials.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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