71 lines
2.9 KiB
Rust
71 lines
2.9 KiB
Rust
//! RPC compatibility surface for the `aria2-rust-pro` workspace.
|
|
//!
|
|
//! This crate owns request parsing, transport-neutral routing, JSON-RPC and
|
|
//! XML-RPC compatibility types, and the in-process dispatcher used by the
|
|
//! server-facing crates.
|
|
#![expect(
|
|
clippy::multiple_crate_versions,
|
|
reason = "workspace dependency resolution is shared across crates and not owned by rpc alone"
|
|
)]
|
|
#![forbid(unsafe_code)]
|
|
|
|
#[cfg(test)]
|
|
use aria2_rust_pro_storage as _;
|
|
|
|
/// In-process RPC dispatcher backed by the download engine.
|
|
pub(crate) mod dispatcher;
|
|
/// RPC method registry and request handlers.
|
|
pub(crate) mod handlers;
|
|
/// JSON-RPC request and response types plus serde helpers.
|
|
pub(crate) mod jsonrpc;
|
|
/// Canonical RPC method metadata.
|
|
pub(crate) mod methods;
|
|
/// Shared RPC value, error, and metadata model types.
|
|
pub(crate) mod model;
|
|
/// Transport-neutral request routing helpers.
|
|
pub(crate) mod router;
|
|
/// Minimal HTTP and WebSocket server glue for the RPC surface.
|
|
pub(crate) mod server;
|
|
/// Session and authentication token state.
|
|
pub(crate) mod session;
|
|
/// WebSocket notification fan-out helpers.
|
|
pub(crate) mod websocket;
|
|
/// XML-RPC request and response types plus parser/renderer helpers.
|
|
pub(crate) mod xmlrpc;
|
|
|
|
/// Re-exports of the in-process dispatcher and lightweight internal summaries.
|
|
pub use dispatcher::{InProcessRpcDispatcher, RpcStatusSummary};
|
|
/// Re-exports of the primary JSON-RPC message types and testable wire codecs.
|
|
pub use jsonrpc::{
|
|
JsonRpcNotification, JsonRpcRequest, JsonRpcResponse, jsonrpc_request_from_json,
|
|
};
|
|
/// Re-exports of the RPC method catalog and lookup helpers.
|
|
pub use methods::{
|
|
REQUIRED_RPC_METHODS, RPC_METHOD_LEDGER, RpcMethod, is_required_rpc_method, rpc_method_names,
|
|
};
|
|
/// Re-exports of the shared RPC model types.
|
|
pub use model::{
|
|
RpcAuthContext, RpcError, RpcErrorCode, RpcErrorKind, RpcMeta, RpcOptionMap, RpcResultEnvelope,
|
|
RpcValue,
|
|
};
|
|
/// Re-exports of the transport-neutral router types.
|
|
pub use router::{RpcDispatchRequest, RpcDispatchResult, RpcRouter};
|
|
/// Re-exports of the server configuration and entrypoints.
|
|
pub use server::{
|
|
RpcListenerStub, RpcServerConfig, RpcServerTransport, RpcServerTransportConfig,
|
|
serve_rpc_listener,
|
|
};
|
|
/// Re-exports of RPC session state types.
|
|
pub use session::{RpcAuthToken, RpcSession, RpcSessionInfo, RpcSessionStore};
|
|
/// Re-exports of WebSocket notification types and registries.
|
|
pub use websocket::{
|
|
RpcNotificationEvent, RpcNotificationKind, RpcWebSocketFrame, WebSocketNotificationRegistry,
|
|
WebSocketSessionRegistry, WebSocketSessionState, WebSocketSubscription,
|
|
};
|
|
/// Re-exports of XML-RPC model types and wire codec helpers.
|
|
pub use xmlrpc::{
|
|
XmlRpcFault, XmlRpcMember, XmlRpcMethodCall, XmlRpcMethodResponse, XmlRpcParam, XmlRpcValue,
|
|
rpc_value_to_xmlrpc, xmlrpc_method_call_from_xml, xmlrpc_method_call_to_xml,
|
|
xmlrpc_method_response_from_xml, xmlrpc_method_response_to_xml, xmlrpc_value_to_rpc,
|
|
};
|