ctoolbox/workspace/
ipc.rs

1use std::sync::LazyLock;
2
3use crate::workspace::ipc::protocol::Response;
4
5pub mod auth;
6pub mod data_plane;
7pub mod error;
8pub mod multiplex;
9pub mod platform;
10pub mod process_manager;
11pub mod protocol;
12pub mod router;
13pub mod services;
14pub mod transport;
15pub mod types;
16
17// process is for calls that apply to any subprocess, e.g. graceful shutdown
18pub static IPC_API: LazyLock<Vec<&str>> = LazyLock::new(|| {
19    vec![
20        "process",
21        "formats",
22        "io",
23        "network",
24        "renderer",
25        "storage",
26        "workspace",
27    ]
28});
29
30pub fn assert_ipc_response_ok(response: &Response) {
31    assert!(response.ok, "IPC response indicates failure: {response:?}");
32}
33
34pub fn assert_ipc_response_error(response: &Response) {
35    assert!(
36        !response.ok,
37        "IPC response indicates success when error expected: {response:?}"
38    );
39}