pub enum Address {
Domain(Domain, u16),
IPv4(SocketAddrV4),
IPv6(SocketAddrV6),
}Expand description
§ADDRESS
+------------+------------------------+------------------------+
| ATYP (1) | ADDR (*) | PORT (2) |
+------------+------------------------+------------------------+§ATYP
+------+--------------+
| Bits | ATYP |
+======+==============+
| 0x01 | Domain |
+------+--------------+
| 0x02 | IPv4 |
+------+--------------+
| 0x03 | IPv6 |
+------+--------------+Variants§
Implementations§
Source§impl Address
impl Address
pub fn format_as_string(&self) -> Result<String>
pub fn to_bytes(&self) -> Result<Bytes>
pub fn from_bytes<B: Buf>(buf: &mut B) -> Result<Self>
pub async fn to_socket_addr(self) -> Result<SocketAddr>
Trait Implementations§
Source§impl From<SocketAddr> for Address
impl From<SocketAddr> for Address
Source§fn from(value: SocketAddr) -> Self
fn from(value: SocketAddr) -> Self
Converts to this type from the input type.
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