Derive Macro AsSocketDescriptor

Source
#[derive(AsSocketDescriptor)]
{
    // Attributes available to this derive:
    #[descriptor]
}
Expand description

#[derive(AsSocketDescriptor)]

Derives std::os::fd::{AsFd, AsRawFd} and std::os::windows::io::{AsSocket, AsRawSocket} for the given struct.

Supported attributes:

  • #[descriptor]: Marks the field as a socket descriptor.
  • #[descriptor(as_ref)]: Delegates the field to the inner type using AsRef/AsMut.
  • #[descriptor(deref)]: Delegates the field to the inner type using Deref/DerefMut.
  • #[descriptor(<function>=<override>)]: Overrides the default <function> method with the given override function.