Expand description
IPC (“inter-process communication”) abstractions used on Linux.
NOTE: the actual implementations may be portable to other OSes, e.g. “UNIX domain sockets” are definitely not Linux-only, but there may be other reasons to only need them on Linux such as macOS
Structs§
- Channel
- One endpoint of a bi-directional inter-process communication channel,
capable of sending/receiving both raw bytes and UNIX file descriptors,
encoded/decoded from/to the
TX
/RX
types, with an ordering guarantee (messages will be received in the same order that they were sent). - Inheritable
Channel - A
Channel<TX, RX>
whose internal (UNIX domain socket) file descriptor will persist in all child proceses (except for those which explicitly close it), and which only provides conversions to/from file descriptors, and a way to disable inheritance (i.e. re-enablingCLOEXEC
semantics on it).
Enums§
- Never
- Type with no values to make it impossible to send on a channel endpoint, or receive on its opposite counterpart, if that direction is unused.
Traits§
- Fixed
Size Encoding - Encoding/decoding functionality that relies on each message being
encoded to a constant (and small) “packet” size, allowing the use
of 1:1
sendmsg
andrecvmsg
calls, i.e. removing the need for any kind of “packet framing” that aSOCK_STREAM
needs to soundly handle receiving a message’s fds through multiplerecvmsg
calls.