6 个版本
| 0.1.5 | 2023 年 3 月 15 日 |
|---|---|
| 0.1.4 | 2021 年 11 月 9 日 |
| 0.1.3 | 2021 年 10 月 6 日 |
| 0.1.2 | 2019 年 10 月 12 日 |
| 0.1.0 | 2018 年 10 月 27 日 |
#1212 在 编码
43 每月下载
用于 tango-client
145KB
4.5K SLoC
tango-rs
此库是 Tango 控制系统服务器的客户端。它使用现有的 C 语言绑定(包含在内)并在 Rust 接口中封装了由它提供的 API 函数。
设备代理 API 调用
command_inoutcommand_querycommand_list_queryget_attribute_listget_attribute_configattribute_list_queryread/write_attributeread/write_attributesget/put/delete_device_propertyget/set_timeoutget/set_sourcelock/unlock/is_locked
数据库 API 调用
get_device_exported/_for_classget_object_listget_object_property_listget/put/delete_property
构建
您需要一个带有头文件的已安装的 Tango 库。如果默认情况下找不到,请将环境变量 PKG_CONFIG_PATH 设置为包含 tango.pc 的目录。
最低支持的 Rust 版本
此包已测试至 Rust 1.41.1。
Serde 集成
当激活 serde 功能时,可以使用 serde 对 CommandData、AttrValue 和 PropertyValue 类型进行序列化和反序列化。这允许快速将它们转换为/从 JSON 等格式。
测试
对于测试/基准测试,您需要一个运行在 localhost:10000 的 Tango 数据库,以及标准测试服务器的默认实例 (TangoTest/test)。
然后,您可以通过运行 cargo test 来测试所有封装的 API,并通过运行 cargo bench 来测量 command_inout 往返的时间。
依赖项
~230KB