pub enum Address {
IPv4(SocketAddrV4),
IPv6(SocketAddrV6),
Domain(String, u16),
}Variants§
Implementations§
Source§impl Address
impl Address
pub fn from_socket_address(address: SocketAddr) -> Self
Trait Implementations§
Source§impl Streamable for Address
impl Streamable for Address
Source§async fn read<T>(stream: &mut T) -> Result<Self>
async fn read<T>(stream: &mut T) -> Result<Self>
§Address
§Stream
+------+----------+----------+
| ATYP | DST.ADDR | DST.PORT |
+------+----------+----------+
| 1 | Variable | 2 |
+------+----------+----------+§DST.ADDR BND.ADDR
In an address field (DST.ADDR, BND.ADDR), the ATYP field specifies the type of address contained within the field:
o ATYP: X’01’ the address is a version-4 IP address, with a length of 4 octets
o ATYP: X’03’ the address field contains a fully-qualified domain name. The first octet of the address field contains the number of octets of name that follow, there is no terminating NUL octet.
o ATYP: X’04’
the address is a version-6 IP address, with a length of 16 octets.
fn write<T>(&self, stream: &mut T) -> impl Future<Output = Result<()>> + Send
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