MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / as_any

Method as_any

src/net/addr.rs:71–79  ·  view source on GitHub ↗

Convert to `SocketAddrAny`.

(&self)

Source from the content-addressed store, hash-verified

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 ///

Callers 4

fromMethod · 0.80
fromMethod · 0.80
clientFunction · 0.80
clientFunction · 0.80

Implementers 3

types.rssrc/net/types.rs
socket_addr_any.rssrc/net/socket_addr_any.rs
addr.rssrc/net/addr.rs

Calls 2

write_sockaddrMethod · 0.80
as_mut_ptrMethod · 0.45

Tested by

no test coverage detected