Expand description
§RPFM IPC - Inter-Process Communication Protocol
This crate defines the IPC protocol used for communication between the RPFM frontend
and the backend server (rpfm_server). It provides type-safe message definitions that ensure
consistent communication between the two processes.
§Protocol Overview
The communication follows a request-response pattern over WebSocket connections:
- The frontend creates a
messages::Message<Command>with a unique ID - The message is serialized to JSON and sent over WebSocket to the server
- The server processes the command and sends back a
messages::Message<Response> - The frontend matches the response ID to the original request
This ID correlation mechanism enables asynchronous, non-blocking communication where multiple requests can be in flight simultaneously.
§Modules
messages: Core protocol definitions includingmessages::Command,messages::Response, and themessages::Messagewrapper.helpers: Data structures for marshalling complex data between UI and server, includinghelpers::ContainerInfo,helpers::RFileInfo, andhelpers::DataSource.
§Usage
This crate is not intended for standalone use. It serves as a shared dependency between
rpfm_server and rpfm_ui, providing the common language they need to communicate.
§Example Message Flow
ⓘ
// Frontend creates a command
let command = Message {
id: 1,
data: Command::OpenPackFiles(vec![PathBuf::from("/path/to/pack.pack")]),
};
// Serialize and send over WebSocket...
// Server responds with matching ID
let response = Message {
id: 1, // Same ID as the request
data: Response::ContainerInfo(container_info),
};Modules§
- helpers
- IPC Helpers Module
- messages
- IPC Messages Module
- settings_
keys - Typed constants for all settings keys used across the application.