Convert to `SocketAddrAny`.
(&self)
| 69 | |
| 70 | /// Convert to `SocketAddrAny`. |
| 71 | fn as_any(&self) -> SocketAddrAny { |
| 72 | let mut storage = MaybeUninit::<SocketAddrStorage>::uninit(); |
| 73 | // SAFETY: We've allocated `storage` here, we're writing to it, and |
| 74 | // we're using the number of bytes written. |
| 75 | unsafe { |
| 76 | let len = self.write_sockaddr(storage.as_mut_ptr()); |
| 77 | SocketAddrAny::new(storage, len) |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | /// Encode an address into a `SocketAddrStorage`. |
| 82 | /// |
no test coverage detected