pub struct MappedSocketAddr { /* private fields */ }Expand description
Helper struct for SocketAddrs that are stored as an attribute.
Implementations§
Source§impl MappedSocketAddr
impl MappedSocketAddr
Sourcepub fn new(addr: SocketAddr) -> Self
pub fn new(addr: SocketAddr) -> Self
Create a new MappedSocketAddr.
Sourcepub fn length(&self) -> u16
pub fn length(&self) -> u16
The number of bytes of this MappedSocketAddr.
Sourcepub fn to_raw(&self, atype: AttributeType) -> RawAttribute<'_>
pub fn to_raw(&self, atype: AttributeType) -> RawAttribute<'_>
Convert this MappedSocketAddr into a RawAttribute
Sourcepub fn from_raw(raw: &RawAttribute<'_>) -> Result<Self, StunParseError>
pub fn from_raw(raw: &RawAttribute<'_>) -> Result<Self, StunParseError>
Try to convert a RawAttribute into a MappedSocketAddr
Sourcepub fn addr(&self) -> SocketAddr
pub fn addr(&self) -> SocketAddr
The SocketAddr in this MappedSocketAddr
Sourcepub fn write_into_unchecked(&self, dest: &mut [u8])
pub fn write_into_unchecked(&self, dest: &mut [u8])
Write the MappedSocketAddr to the provided destination buffer.
Trait Implementations§
Source§impl Clone for MappedSocketAddr
impl Clone for MappedSocketAddr
Source§fn clone(&self) -> MappedSocketAddr
fn clone(&self) -> MappedSocketAddr
Returns a duplicate 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 MappedSocketAddr
impl Debug for MappedSocketAddr
Source§impl Display for MappedSocketAddr
impl Display for MappedSocketAddr
Source§impl PartialEq for MappedSocketAddr
impl PartialEq for MappedSocketAddr
impl Eq for MappedSocketAddr
impl StructuralPartialEq for MappedSocketAddr
Auto Trait Implementations§
impl Freeze for MappedSocketAddr
impl RefUnwindSafe for MappedSocketAddr
impl Send for MappedSocketAddr
impl Sync for MappedSocketAddr
impl Unpin for MappedSocketAddr
impl UnwindSafe for MappedSocketAddr
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