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

Method size

src/net/send_recv/msg.rs:165–173  ·  view source on GitHub ↗

Get the maximum size of an ancillary message. This can be used to determine the size of the buffer to allocate for a [`SendAncillaryBuffer::new`] with one message.

(&self)

Source from the content-addressed store, hash-verified

163 /// This can be used to determine the size of the buffer to allocate for a
164 /// [`SendAncillaryBuffer::new`] with one message.
165 pub const fn size(&self) -> usize {
166 match self {
167 Self::ScmRights(slice) => cmsg_space!(ScmRights(slice.len())),
168 #[cfg(linux_kernel)]
169 Self::ScmCredentials(_) => cmsg_space!(ScmCredentials(1)),
170 #[cfg(target_os = "linux")]
171 Self::TxTime(_) => cmsg_space!(TxTime(1)),
172 }
173 }
174}
175
176/// Ancillary message for [`recvmsg`].

Callers 2

test_unix_peercredFunction · 0.80

Calls

no outgoing calls

Tested by 2

test_unix_peercredFunction · 0.64