mxcubecore.ipc.models¶
Pydantic envelope models for the mxcubecore IPC wire format.
See IPC_FORMAT.md for the full wire format description. The envelope is JSON-RPC 2.0 shaped and shared verbatim by both transports (JSON-RPC/TCP and NanoMQ) so the core dispatch logic in mxcubecore.ipc.server never has to know which transport carried a message.
Classes
|
Error payload carried in an IPCErrorResponse. |
|
Error reply to an IPCRequest. |
|
A server-initiated notification (no id, no reply expected). |
|
A command sent by the client to invoke one whitelisted method. |
|
Successful reply to an IPCRequest. |
- class mxcubecore.ipc.models.IPCError(*, code: int, message: str, data: Any | None = None)[source]¶
Bases:
BaseModelError payload carried in an IPCErrorResponse.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class mxcubecore.ipc.models.IPCErrorResponse(*, jsonrpc: Literal['2.0'] = '2.0', id: str | int | None = None, error: IPCError)[source]¶
Bases:
_JsonRpcError reply to an IPCRequest.
id is None when the request’s id couldn’t be determined (e.g. parse error).
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class mxcubecore.ipc.models.IPCEvent(*, jsonrpc: ~typing.Literal['2.0'] = '2.0', method: str, params: ~typing.Dict[str, ~typing.Any] = <factory>)[source]¶
Bases:
_JsonRpcA server-initiated notification (no id, no reply expected).
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class mxcubecore.ipc.models.IPCRequest(*, jsonrpc: ~typing.Literal['2.0'] = '2.0', id: str | int, method: str, params: ~typing.Dict[str, ~typing.Any] = <factory>)[source]¶
Bases:
_JsonRpcA command sent by the client to invoke one whitelisted method.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class mxcubecore.ipc.models.IPCResponse(*, jsonrpc: Literal['2.0'] = '2.0', id: str | int, result: Any = None)[source]¶
Bases:
_JsonRpcSuccessful reply to an IPCRequest.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].