anchovy 0.1.0

Async Unix socket stream with file descriptor passing
Documentation
  • Coverage
  • 0%
    0 out of 5 items documented0 out of 2 items with examples
  • Size
  • Source code size: 321.95 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.18 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 44s Average build duration of successful builds.
  • all releases: 44s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • tailwags/anchovy
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • puppymati

anchovy

Unix sockets can carry open file descriptors alongside data, but nothing in the standard async I/O stack handles this. In async Rust you have to drop down to sendmsg/recvmsg yourself. anchovy handles that: it wraps a UnixStream and implements AsyncRead/AsyncWrite with fd passing via SCM_RIGHTS ancillary messages.

Usage

AnchovyStream exposes two public queues: encode_fds and decode_fds. To send file descriptors, push OwnedFd values into encode_fds before writing. Received descriptors land in decode_fds after a read.

Origin

waynest and abus both needed this and ended up writing the same wrapper independently. anchovy is that wrapper, extracted into a shared crate before the two implementations diverged further.

License

This project is licensed under the Apache-2.0 License. For more information, please see the LICENSE file.