oino_rpc/lib.rs
1//! `oino-rpc`: the JSONL RPC protocol (`--mode rpc`) for Oino.
2//!
3//! Strict JSONL over any byte stream: commands in, replies and client events out, with the
4//! extension UI sub-protocol (`extension_ui_request` / `extension_ui_response`) and the Oino
5//! extensions behind `_oino/hello` (modes.md §3–§4).
6//!
7//! # API map
8//!
9//! | Module | Contents |
10//! |---|---|
11//! | [`jsonl`] | [`jsonl::LineReader`], [`jsonl::serialize_line`] |
12//! | [`wire`] | [`wire::session_event_json`] (also JSON mode), [`wire::rpc_event`] filtering |
13//! | [`server`] | [`RpcServer`] over any `SessionBackend` |
14//! | [`client`] | [`RpcClient`]: typed methods, [`Transport::StdioChild`] |
15//! | [`backend`] | [`RpcBackend`]: `SessionBackend` over an [`RpcClient`]; [`backend::EventDecoder`] |
16//!
17//! `RpcBackend` lives here rather than in `oino-client` because `oino-rpc` already depends
18//! on `oino-client` (deviations/modes.md).
19
20#![forbid(unsafe_code)]
21#![cfg_attr(
22 test,
23 allow(
24 clippy::unwrap_used,
25 clippy::expect_used,
26 clippy::panic,
27 reason = "tests assert by unwrapping"
28 )
29)]
30
31pub mod backend;
32pub mod client;
33pub mod jsonl;
34pub mod server;
35pub mod wire;
36
37pub use backend::RpcBackend;
38pub use client::{ChildCommand, RpcClient, Transport};
39pub use server::{RpcServer, RpcServerError};