pub struct Message { /* private fields */ }
Expand description
STUN message.
Implementations
sourceimpl 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 RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more