Struct stun_client::Message
source · 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§
source§impl PartialEq<Message> for Message
impl PartialEq<Message> for Message
impl Eq for Message
impl StructuralEq for Message
impl StructuralPartialEq for Message
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§
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