pub struct Message { /* private fields */ }
Expand description
Struct representing STUN message
Implementations§
Source§impl Message
impl Message
Sourcepub fn new(
method: Method,
class: Class,
attributes: Option<HashMap<Attribute, Vec<u8>>>,
) -> Message
pub fn new( method: Method, class: Class, attributes: Option<HashMap<Attribute, Vec<u8>>>, ) -> Message
Create a STUN Message.
Sourcepub fn from_raw(buf: &[u8]) -> Result<Message, STUNClientError>
pub fn from_raw(buf: &[u8]) -> Result<Message, STUNClientError>
Create a STUN message from raw bytes.
Sourcepub fn get_method(&self) -> Method
pub fn get_method(&self) -> Method
Get the method from Message.
Sourcepub fn get_raw_attr_value(&self, attr: Attribute) -> Option<Vec<u8>>
pub fn get_raw_attr_value(&self, attr: Attribute) -> Option<Vec<u8>>
Get the raw attribute bytes from Message.
Sourcepub fn get_transaction_id(&self) -> Vec<u8> ⓘ
pub fn get_transaction_id(&self) -> Vec<u8> ⓘ
Get the transaction id from Message.
Trait Implementations§
impl Eq for Message
impl StructuralPartialEq for Message
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