pub struct MessageEncoder { /* private fields */ }
Expand description
Class used to encode STUN messages
Implementations§
source§impl MessageEncoder
impl MessageEncoder
sourcepub fn encode(
&self,
buffer: &mut [u8],
msg: &StunMessage,
) -> Result<usize, StunEncodeError>
pub fn encode( &self, buffer: &mut [u8], msg: &StunMessage, ) -> Result<usize, StunEncodeError>
Encodes a STUN message.
§Arguments:
buffer
- Output buffermsg
- The STUN message.
§Returns:
The size in bytes taken to encode the msg
or a StunEncodeError
describing
the error if the message could not be encoded.
Trait Implementations§
source§impl Clone for MessageEncoder
impl Clone for MessageEncoder
source§fn clone(&self) -> MessageEncoder
fn clone(&self) -> MessageEncoder
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 MessageEncoder
impl Debug for MessageEncoder
source§impl Default for MessageEncoder
impl Default for MessageEncoder
source§fn default() -> MessageEncoder
fn default() -> MessageEncoder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MessageEncoder
impl RefUnwindSafe for MessageEncoder
impl Send for MessageEncoder
impl Sync for MessageEncoder
impl Unpin for MessageEncoder
impl UnwindSafe for MessageEncoder
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
)