tokio_unix_ipc/
lib.rs

1//! # tokio-unix-ipc
2//!
3//! This crate implements a minimal abstraction over UNIX domain sockets for
4//! the purpose of IPC on top of tokio. It lets you send both file handles and
5//! rust objects between processes. This is a replacement for my earlier
6//! [unix-ipc](https://github.com/mitsuhiko/unix-ipc) crate.
7//!
8//! ## How it works
9//!
10//! This uses [serde](https://serde.rs/) to serialize data over unix sockets
11//! via [bincode](https://github.com/bincode-org/bincode). Thanks to the
12//! [`Handle`](crate::serde::Handle) abstraction you can also send any object
13//! across that is convertable into a unix file handle.
14//!
15//! The way this works under the hood is that during serialization and
16//! deserialization encountered file descriptors are tracked. They are then
17//! sent over the unix socket separately. This lets unassociated processes
18//! share file handles.
19//!
20//! If you only want the unix socket abstraction you can disable all default
21//! features and use the raw channels.
22//!
23//! ## Features
24//!
25//! * `serde`: enables support for the non raw types
26//! * `serde-structural`: enables support for structural data passing
27//! * `bootstrap`: adds support for boostrapping
28//! * `panic-support`: adds support for IPC panic catching
29//! * `backtrace`: adds support for backtraces to panics
30
31// because of PanicInfo
32#![allow(deprecated)]
33
34mod raw_channel;
35
36#[cfg(feature = "serde")]
37pub mod serde;
38
39#[cfg(feature = "serde")]
40mod typed_channel;
41
42#[cfg(feature = "panic-support")]
43pub mod panic;
44
45#[cfg(feature = "bootstrap")]
46mod bootstrap;
47
48pub use self::raw_channel::*;
49
50#[cfg(feature = "serde")]
51pub use self::typed_channel::*;
52
53#[cfg(feature = "bootstrap")]
54pub use self::bootstrap::*;
55
56#[doc(hidden)]
57#[cfg(feature = "serde")]
58pub use ::serde_ as _serde_ref;