pub struct MessageDecoder { /* private fields */ }
Expand description
Class used to decode STUN messages
Implementations§
source§impl MessageDecoder
impl MessageDecoder
sourcepub fn decode(
&self,
buffer: &[u8],
) -> Result<(StunMessage, usize), StunDecodeError>
pub fn decode( &self, buffer: &[u8], ) -> Result<(StunMessage, usize), StunDecodeError>
Decodes the STUN raw buffer
§Arguments:
buffer
- Raw buffer containing the STUN message
§Returns:
A tuple with StunMessage
itself and the size consumed to decode the message,
or an error describing the problem if the message could not be decoded.
sourcepub fn get_context(&self) -> Option<&DecoderContext>
pub fn get_context(&self) -> Option<&DecoderContext>
Gets the context associated to this decoder
Trait Implementations§
source§impl Clone for MessageDecoder
impl Clone for MessageDecoder
source§fn clone(&self) -> MessageDecoder
fn clone(&self) -> MessageDecoder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for MessageDecoder
impl Debug for MessageDecoder
source§impl Default for MessageDecoder
impl Default for MessageDecoder
source§fn default() -> MessageDecoder
fn default() -> MessageDecoder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MessageDecoder
impl RefUnwindSafe for MessageDecoder
impl !Send for MessageDecoder
impl !Sync for MessageDecoder
impl Unpin for MessageDecoder
impl UnwindSafe for MessageDecoder
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)