paw-gui/src-tauri/README.md
2025-04-14 19:17:53 +08:00

2.0 KiB
Raw Permalink Blame History

Paw GUi

Paw 的 GUI 客户端,基于 Tauri 构建。

有关系统服务部分,请看其独立的文档,有关整体、前端和构建,请看上一级的文档

项目结构

  • capabilities/ 用于管理窗口组的权限,请看文档
  • icons/ 软件使用的图标
  • rust-toolchain.toml 固定工具链版本
  • rustfmt.toml 格式化方案
  • tauri.config.json tauri 框架的配置文件,后期可能根据操作系统拆分成三个文件,注意其中的 build 选项
  • build.rs 构建脚本
  • system-service 用于管理系统服务,是独立的 package内含三个 crate
  • common 存放一些公共的代码,所有 crate 都依赖它
  • install-scripts 打包时需要用的脚本包含win、linux和macos的脚本
  • src/
    • main.rs 二进制 crate 入口文件,一般不需要修改
    • lib.rs 真正的程序入口
    • cmds.rs 前端可以调用的指令,其中功能指向具体实现模块
    • core/ 与核心交互模块
    • service/ 与系统服务交互模块

第三方库依赖

  • tauri: 基础应用框架
  • serde & serde_json: 序列化/反序列化框架
  • specta & specta-typescript: 将 Rust 类型生成为 ts 类型
  • tauri-specta 生成 bindings.ts 中的 command、event 和类型代码,请使用这个库来创建需要传输的类型、command 和 event
  • reqwest HTTP客户端
  • anyhow 简化错误处理
  • tracing 日志门面库
  • tracing-subscriber 日志实现库
  • tokio 异步运行时,也包含了很多异步实用工具
  • elevated-command 用于提权安装系统服务