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)
| 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`]. |
no outgoing calls