interprocess_helpers/
lib.rs

1//! Wrapper around [`interprocess::local_socket::tokio`](https://docs.rs/interprocess/2.2.3/interprocess/local_socket/tokio/index.html) for convenient communication
2//! between multiple Rust processes.
3//!
4//! # Use Cases
5//! Whenever you need two processes to communicate with each other but you can't use stdin and
6//! stdout or other methods. An example would be communication between an elevated app and a non
7//! elevated one on Windows.
8//!
9//! This crate also includes a helper function to easily bundle a different rust project with your main app.
10//! In comparison to [`interprocess`](https://crates.io/crates/interprocess),
11//! this crate is a little simpler to use as it abstracts more logic away (at the cost of flexibility).
12//! In contrast to local sockets in [`interprocess`](https://crates.io/crates/interprocess), this
13//! crate also allows the user to have multiple, clonable and sendable writers that send information to another process as
14//! opposed to just one.
15//!
16//! # Example
17//! A main app (controller) communicates with another app (connector).
18//!
19//! **Main App (controller):**
20//! ```
21#![doc = doctest_file::include_doctest!("examples/ping_pong_controller.rs")]
22//! ```
23//!
24//! **Other App (connector):**
25//! ```no_run
26#![doc = doctest_file::include_doctest!("examples/ping_pong_connector.rs")]
27//! ```
28
29#[cfg(any(feature = "connector", feature = "controller"))]
30mod connection;
31#[cfg(any(feature = "connector", feature = "controller"))]
32pub use connection::*;
33
34#[cfg(any(feature = "connector", feature = "controller"))]
35mod error;
36#[cfg(any(feature = "connector", feature = "controller"))]
37pub use error::*;
38
39#[cfg(feature = "build")]
40pub mod build;
41
42#[cfg(feature = "connector")]
43pub mod connector;
44
45#[cfg(feature = "controller")]
46pub mod controller;