Skip to main content

rpfm_ipc/
lib.rs

1//---------------------------------------------------------------------------//
2// Copyright (c) 2017-2026 Ismael Gutiérrez González. All rights reserved.
3//
4// This file is part of the Rusted PackFile Manager (RPFM) project,
5// which can be found here: https://github.com/Frodo45127/rpfm.
6//
7// This file is licensed under the MIT license, which can be found here:
8// https://github.com/Frodo45127/rpfm/blob/master/LICENSE.
9//---------------------------------------------------------------------------//
10
11//! # RPFM IPC - Inter-Process Communication Protocol
12//!
13//! This crate defines the protocol used between RPFM's clients (the UI, MCP clients and scripts) and the backend
14//! server (`rpfm_server`), and the settings both sides share.
15//!
16//! ## Protocol Overview
17//!
18//! Clients call typed methods of the server over JSON-RPC 2.0, sent as WebSocket text frames:
19//!
20//! 1. The client sends an [`api::RpcRequest`] with a unique ID, a method name like `table.rows`, and its params.
21//! 2. The server answers with an [`api::RpcResponse`] with the same ID, holding the result or an [`api::ApiError`].
22//! 3. Long methods run as jobs: they answer right away with a job ID, and report their progress and result in
23//!    `job.updated` notifications.
24//!
25//! Each method is a struct implementing [`api::Request`], which ties it to its name and response type.
26//!
27//! ## Modules
28//!
29//! - [`api`]: The methods, grouped by domain, and the JSON-RPC envelope.
30//! - [`helpers`]: Data structures shared by several methods, like [`helpers::ContainerInfo`], [`helpers::RFileInfo`]
31//!   and [`helpers::DataSource`].
32//! - [`settings`]: The settings store and the config folder helpers.
33//! - [`settings_keys`]: The keys of the settings.
34
35pub mod api;
36pub mod helpers;
37pub mod settings;
38pub mod settings_keys;