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_attr(docsrs, feature(doc_cfg))]
30
31#[cfg(any(feature = "connector", feature = "controller"))]
32mod connection;
33#[cfg(any(feature = "connector", feature = "controller"))]
34#[cfg_attr(docsrs, doc(cfg(any(feature = "connector", feature = "controller"))))]
35pub use connection::*;
36
37#[cfg(any(feature = "connector", feature = "controller"))]
38mod error;
39#[cfg(any(feature = "connector", feature = "controller"))]
40#[cfg_attr(docsrs, doc(cfg(any(feature = "connector", feature = "controller"))))]
41pub use error::*;
42
43#[cfg(feature = "build")]
44#[cfg_attr(docsrs, doc(cfg(feature = "build")))]
45pub mod build;
46
47#[cfg(feature = "connector")]
48#[cfg_attr(docsrs, doc(cfg(feature = "connector")))]
49pub mod connector;
50
51#[cfg(feature = "controller")]
52#[cfg_attr(docsrs, doc(cfg(feature = "controller")))]
53pub mod controller;