docs.rs failed to build lua-bind-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Lua-Bind - Rust与Lua的无缝绑定库
一个高性能、线程安全的Rust到Lua的绑定系统,提供自动类型注册和依赖注入功能。
功能特性
- 🚀 自动类型注册 - 通过宏自动将Rust类型暴露给Lua
- 🔒 线程安全 - 内置线程安全的Lua状态管理
- ⚡ 高性能 - 零成本抽象,最小化运行时开销
- 🔄 双向交互 - 支持双向调用(Rust→Lua和Lua→Rust)
- 📦 模块化设计 - 可扩展的架构设计
安装
在Cargo.toml中添加:
[]
= { = "0.1", = ["async"] } # 按需启用特性
可选特性:
async- 启用异步支持vendored- 静态链接Lua库
快速开始
基本类型绑定
use ;
;
register_binding!;
异步支持
;
进阶用法
序列化支持
多线程安全
let handles: = .map.collect;
API参考
完整API文档见: docs.rs/lua-bind
示例代码
查看examples/目录获取更多示例:
basic.rs- 基础用法async.rs- 异步交互serialization.rs- 序列化示例
运行示例
test-async只为了适配async案例设计的特性,不建议直接使用
贡献指南
欢迎提交Issue和PR!开发前请阅读:
- 运行测试:
cargo test --all-features - 检查格式:
cargo fmt --all - 更新文档和CHANGELOG
许可证
本项目采用双重许可: