12 releases

0.4.2 Mar 15, 2023
0.4.1 Nov 9, 2021
0.3.2 Oct 6, 2021
0.3.1 Aug 2, 2021
0.1.0 Oct 27, 2018

#2422 in Database interfaces

Download history 4/week @ 2024-07-28 1/week @ 2024-09-22 5/week @ 2024-09-29

52 downloads per month

LGPL-3.0+

370KB
8K SLoC

Rust 7K SLoC // 0.0% comments C 1.5K SLoC // 0.1% comments

tango-rs

This library is a client for Tango control system servers. It uses the preexisting C bindings (included) and wraps the API functions provided by it in a Rustic interface.

Device proxy API calls:

  • command_inout
  • command_query
  • command_list_query
  • get_attribute_list
  • get_attribute_config
  • attribute_list_query
  • read/write_attribute
  • read/write_attributes
  • get/put/delete_device_property
  • get/set_timeout
  • get/set_source
  • lock/unlock/is_locked

Database API calls:

  • get_device_exported/_for_class
  • get_object_list
  • get_object_property_list
  • get/put/delete_property

Building

You need an installed Tango library with headers. Set the PKG_CONFIG_PATH environment variable to the directory that contains tango.pc if it is not found by default.

Minimal supported Rust version

The crate is tested down to Rust 1.41.1.

Serde integration

When the feature serde is activated, the CommandData, AttrValue and PropertyValue types can be serialized and deserialized with serde. This allows quickly converting them from/to JSON, for example.

Testing

For testing/benchmarking, you need a Tango database running on localhost:10000, and the default instance of the standard testing server (TangoTest/test).

Then, you can run cargo test to test all wrapped APIs, and cargo bench to measure the duration of command_inout roundtrips.

Dependencies

~0.6–1.4MB
~25K SLoC