pub enum Address {
SocketAddr(SocketAddr),
Domain(String, u16),
}
Expand description
Address can be IPv4, IPv6 address or a domain with port.
Variants§
SocketAddr(SocketAddr)
Domain(String, u16)
Implementations§
Source§impl Address
impl Address
Sourcepub fn to_socket_addr(self) -> Result<SocketAddr>
pub fn to_socket_addr(self) -> Result<SocketAddr>
Converts to SocketAddr if Address can be convert to. Otherwise AddrNotAvailable is returned.
Trait Implementations§
Source§impl From<SocketAddr> for Address
impl From<SocketAddr> for Address
Source§fn from(addr: SocketAddr) -> Self
fn from(addr: SocketAddr) -> Self
Converts to this type from the input type.
Source§impl IntoAddress for Address
impl IntoAddress for Address
fn into_address(self) -> Result<Address>
fn into_socket_addr(self) -> Result<SocketAddr>where
Self: Sized,
Source§impl Ord for Address
impl Ord for Address
Source§impl PartialOrd for Address
impl PartialOrd for Address
impl Eq for Address
impl StructuralPartialEq for Address
Auto Trait Implementations§
impl Freeze for Address
impl RefUnwindSafe for Address
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnwindSafe for Address
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§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.