Skip to main content

tauri_plugin_py_runtime/bridge/
mod.rs

1//! Rust 与 Python 进程之间的通信层。
2//!
3//! 架构位置:前端 -> Tauri 命令 -> **Bridge -> Writer/FrameCodec** -> Python 进程。
4//! 进程的启动、握手与重启由 [`crate::runtime::Supervisor`] 负责,本模块只处理已建立的连接:
5//!
6//! - [`protocol`]:v2 帧格式与消息类型([`Message`]、[`Frame`]、[`protocol::FrameCodec`]);
7//! - [`transport`]:单写者的帧发送端 [`Writer`];
8//! - [`invoke`]:调用路由 [`Bridge`],负责请求/响应配对、超时、取消以及 channel 与事件分发。
9
10pub mod invoke;
11pub mod protocol;
12pub mod transport;
13
14pub use invoke::{Bridge, CallOptions, ChannelSink, EventSink};
15pub use protocol::{Frame, Message, Payload, DEFAULT_MAX_FRAME_SIZE, PROTOCOL_VERSION};
16pub use transport::Writer;