Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Feature 列表

核心

Feature描述依赖
binary二进制协议 (POST /_api、WS 帧、TCP 帧)
httpHTTP 服务器hyper, hyper-util, http-body-util
wsWebSocket 服务器tokio-tungstenite, futures-util, binary
tcpTCP 服务器 (长度前缀帧)binary

代码生成

Feature描述依赖
tsTypeScript 客户端生成 (ESM + 完整类型)
jsJavaScript 客户端生成 (ESM + JSDoc)
ktKotlin 客户端生成
rsRust 客户端生成 (Tokio 异步 / std 同步 TCP)
csC# / .NET 客户端生成 (HttpClient / WebSocket / TCP)
code按需代码生成,端点 /code/{service}/{lang}http

文档

Feature描述依赖
doc交互式 API 文档,端点 /dochttp, js

Ordinary 路由

Feature描述依赖
ordinary-httpRESTful JSON 端点 (#[get]/#[post] 等)http, serde, serde_json
ordinary-ws基于路径的 WebSocket 端点 (#[ws])ws, ordinary-http
ordinary-sseServer-Sent Events 端点 (#[sse])ordinary-http, futures-util

协议选项

Feature描述
seq64WS 请求 ID 使用 i64(默认 i32
len64WS 负载长度使用 u64(默认 u32
tag-u8枚举标签使用 u8(默认)
tag-u16枚举标签使用 u16
tag-u32枚举标签使用 u32

TLS

Feature描述依赖
tls基于 rustls 的 HTTPS,ALPN 协商 HTTP/2,支持 channel 热重载http, tokio-rustls, rustls, rustls-pemfile

可选能力

Feature描述
marker基于标记的条件序列化,通过 AFast::marker() 设置
hook生命周期钩子 (before_request/on_connect 等),支持全局和按服务配置
rate-limit命名策略的速率限制 (FixedWindow/SlidingWindow/TokenBucket)
tlsTLS/HTTPS 支持,基于 rustls 并支持 ALPN

注意: 如果服务端使用了 seq64len64,生成的客户端代码必须使用相同的 Feature,否则会出现协议不匹配。

已复制到剪贴板!