Expand description
§aiway-plugin
网关插件 SDK,定义插件接口和数据交换类型。
§架构
- 插件侧:插件开发者依赖此 crate,实现
Plugintrait,使用export_wasm!宏导出 WASM - 宿主侧:
plugin-managercrate 提供 wasmtime 运行时,加载并执行 WASM 插件
§数据交换
Host 与 WASM 之间通过 bincode 序列化传递数据,定义在 wasm_types 模块中。
Re-exports§
pub use http;pub use serde_json;
Modules§
- wasm_
types - WASM 插件边界序列化类型
Macros§
- export_
wasm - 导出 WASM 插件
- log_
debug - DEBUG日志
- log_
error - 格式化日志宏(ERROR 级别)
- log_
info - INFO日志
- log_
trace - TRACE日志
- log_
warn - WARN日志
Structs§
- Bytes
- A cheaply cloneable and sliceable chunk of contiguous memory.
- Form
Part - Multipart 表单字段
- Http
Request - HTTP 请求参数
- Http
Request Builder - HTTP 请求构建器
- Http
Response - HTTP 响应结果
- Plugin
Info - 插件信息
- Version
- SemVer version as defined by https://semver.org.
- Wasm
Http Context - WASM 侧的插件上下文实现。
Enums§
- Plugin
Error - 插件错误类型
Constants§
Traits§
- Plugin
- 插件接口 trait
- Plugin
Context - 插件上下文接口
Functions§
- block_
on - 简易 block_on,用于在同步上下文(WASM 内部)中执行 async 函数。