pub struct AlternateServer { /* private fields */ }
Expand description
The AlternateServer Attribute
Implementations§
Source§impl AlternateServer
impl AlternateServer
Sourcepub fn new(addr: SocketAddr) -> Self
pub fn new(addr: SocketAddr) -> Self
Sourcepub fn server(&self) -> SocketAddr
pub fn server(&self) -> SocketAddr
Retrieve the server value
§Examples
let addr = "127.0.0.1:12345".parse().unwrap();
let server = AlternateServer::new(addr);
assert_eq!(server.server(), addr);
Trait Implementations§
Source§impl Attribute for AlternateServer
impl Attribute for AlternateServer
Source§impl AttributeFromRaw<'_> for AlternateServer
impl AttributeFromRaw<'_> for AlternateServer
Source§fn from_raw_ref(raw: &RawAttribute<'_>) -> Result<Self, StunParseError>
fn from_raw_ref(raw: &RawAttribute<'_>) -> Result<Self, StunParseError>
Produce an
Attribute
from a RawAttribute
Source§fn from_raw(raw: RawAttribute<'a>) -> Result<Self, StunParseError>where
Self: Sized,
fn from_raw(raw: RawAttribute<'a>) -> Result<Self, StunParseError>where
Self: Sized,
Produce an
Attribute
from a RawAttribute
Source§impl AttributeStaticType for AlternateServer
impl AttributeStaticType for AlternateServer
Source§const TYPE: AttributeType
const TYPE: AttributeType
The
AttributeType
Source§impl AttributeWrite for AlternateServer
impl AttributeWrite for AlternateServer
Source§fn to_raw(&self) -> RawAttribute<'_>
fn to_raw(&self) -> RawAttribute<'_>
Produce a
RawAttribute
from this Attribute
Source§fn write_into_unchecked(&self, dest: &mut [u8])
fn write_into_unchecked(&self, dest: &mut [u8])
Write attribute to the provided destination buffer. Read more
Source§impl Clone for AlternateServer
impl Clone for AlternateServer
Source§fn clone(&self) -> AlternateServer
fn clone(&self) -> AlternateServer
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 AlternateServer
impl Debug for AlternateServer
Source§impl Display for AlternateServer
impl Display for AlternateServer
Source§impl PartialEq for AlternateServer
impl PartialEq for AlternateServer
Source§impl TryFrom<&RawAttribute<'_>> for AlternateServer
impl TryFrom<&RawAttribute<'_>> for AlternateServer
Source§type Error = StunParseError
type Error = StunParseError
The type returned in the event of a conversion error.
impl Eq for AlternateServer
impl StructuralPartialEq for AlternateServer
Auto Trait Implementations§
impl Freeze for AlternateServer
impl RefUnwindSafe for AlternateServer
impl Send for AlternateServer
impl Sync for AlternateServer
impl Unpin for AlternateServer
impl UnwindSafe for AlternateServer
Blanket Implementations§
Source§impl<A> AttributeExt for A
impl<A> AttributeExt for A
Source§impl<A> AttributeWriteExt for Awhere
A: AttributeWrite + ?Sized,
impl<A> AttributeWriteExt for Awhere
A: AttributeWrite + ?Sized,
Source§fn write_header(&self, dest: &mut [u8]) -> Result<usize, StunWriteError>
fn write_header(&self, dest: &mut [u8]) -> Result<usize, StunWriteError>
Write the 4 byte attribute header into the provided destination buffer returning the
number of bytes written, or an error.
Source§fn write_header_unchecked(&self, dest: &mut [u8]) -> usize
fn write_header_unchecked(&self, dest: &mut [u8]) -> usize
Write the 4 byte attribute header into the provided destination buffer returning the
number of bytes written. Read more
Source§fn write_into(&self, dest: &mut [u8]) -> Result<usize, StunWriteError>
fn write_into(&self, dest: &mut [u8]) -> Result<usize, StunWriteError>
Write this attribute into the provided destination buffer returning the number of bytes
written, or an error.
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