| Crates.io | rusp |
| lib.rs | rusp |
| version | 1.0.1 |
| created_at | 2018-12-27 13:04:44.233977+00 |
| updated_at | 2025-06-20 15:54:39.348855+00 |
| description | The Rust USP toolkit |
| homepage | |
| repository | https://github.com/axiros/rusp |
| max_upload_size | |
| id | 104038 |
| size | 45,516 |
This crate has been proudly sponsored by Axiros, a market leader in device management and monitoring solutions:
rusp-bin (published on crates.io as rusp for backwards compatibility) contains the application part of the rusp ecosystem, which is based on the rusp-lib and rhai-rusp crates.
This crate provides:
rusp application, granting access to library functionality via command line. As of version 1.0, this application is deprecated and superseded by the rusp-run application. At the moment this application supports:
rusp-run application, providing a simple frontend to the rhai-rusp bindings via an embedded Rhai interpreterIn order to download, compile and install the binaries, it is sufficient to have a stable Rust environment and run:
# cargo install rusp
rusp binary?rusp includes a binary with the same name demonstrating some of the uses.
At the moment this mostly allows converting Protobuf encapsulated USP Record and Msg structures into human-readable text and other useful formats like code and to extracting a Msg structure from a Record.
Starting from version 1.0, the rusp binary is deprecated and will be removed in a future version altogether. All encoding functionality and Protobuf output have been removed, the latter due being incompatible with the notice printed about the upcoming removal of the tool. Please use rhai-run instead.
rhai-run binary?We are now also including a simply binary called rusp-run, demonstrating how
to embed the bindings and allowing you to execute Rhai code directly via
command line, read either from stdin or a file.
# rusp-run --script 'let body = rusp::get_builder().with_max_depth(1).with_params(["Device."]).build();
let msg = rusp::msg_builder().with_msg_id ("Foo").with_body (body).build();
print (msg)'
{
"Header": {
"msg_id": "Foo",
"msg_type": "GET"
},
"Body": {
"Request": {
"Get": {
"param_paths": [
"Device."
],
"max_depth": 1
}
}
}
}
More examples can be found at the Rhai-Rusp repository.
Starting with version 0.99, rusp-run also supports a -c switch, which can
be used to process a Rhai script embedded in a /** */ comment to e.g. turn
a comment into an array representing a USP Message or Record in a unittest.
You may use this crate however you like under the BSD 3-Clause Licence.
Feel free to spread the word or drop us a note if you like it. Collaboration on this crate is highly welcome as are pull requests in our GitHub repo.
If you are in need of software for USP management software (agent, controller or testing) or expertise please get in touch with us. We're also happy to solve all other device management and monitoring needs!