Skip to main content

rpytest_ipc/
lib.rs

1//! IPC transport layer for rpytest CLI-daemon communication.
2//!
3//! This crate provides MessagePack framing over Unix sockets (or TCP on Windows)
4//! for communication between the rpytest CLI and the Python daemon.
5
6pub mod framing;
7pub mod transport;
8
9pub use framing::{decode, encode};
10pub use transport::{DaemonClient, IpcError};
11
12/// Default socket path for the daemon.
13#[cfg(unix)]
14pub fn default_socket_path() -> std::path::PathBuf {
15    let runtime_dir = std::env::var("XDG_RUNTIME_DIR").unwrap_or_else(|_| "/tmp".to_string());
16    std::path::PathBuf::from(runtime_dir).join("rpytest.sock")
17}
18
19#[cfg(windows)]
20pub fn default_socket_path() -> String {
21    r"\\.\pipe\rpytest".to_string()
22}