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

Method with_sockaddr

src/net/types.rs:1272–1281  ·  view source on GitHub ↗
(
            &self,
            f: impl FnOnce(*const SocketAddrOpaque, SocketAddrLen) -> R,
        )

Source from the content-addressed store, hash-verified

1270 // handles calling `f` with the needed preconditions.
1271 unsafe impl SocketAddrArg for SocketAddrNetlink {
1272 unsafe fn with_sockaddr<R>(
1273 &self,
1274 f: impl FnOnce(*const SocketAddrOpaque, SocketAddrLen) -> R,
1275 ) -> R {
1276 let mut addr: c::sockaddr_nl = mem::zeroed();
1277 addr.nl_family = c::AF_NETLINK as _;
1278 addr.nl_pid = self.pid;
1279 addr.nl_groups = self.groups;
1280 call_with_sockaddr(&addr, f)
1281 }
1282 }
1283
1284 #[cfg(linux_kernel)]

Callers

nothing calls this directly

Calls 5

call_with_sockaddrFunction · 0.85
interface_indexMethod · 0.80
queue_idMethod · 0.80
flagsMethod · 0.45
as_raw_fdMethod · 0.45

Tested by

no test coverage detected