2 releases (1 stable)

8.0.0 May 15, 2019
0.1.0 Jan 23, 2019

#5 in #varlink

MIT/Apache

49KB
985 lines

varlink for rust

Varlink Certified Build Status GitHub Workflow Status Coverage Status Crate Rust Documentation dependency status Rust Version 1.70+

See http://varlink.org for more information about varlink.

Example usage

Look into the examples directory. build.rs contains the magic, which will build rust bindings for the varlink interface definition file. Or use varlink_derive to generate the bindings at compile time.

More Info


lib.rs:

Macro for generating modules from a varlink interface definition

It has the drawback, that most IDEs don't execute this and thus offer no code completion.

Examples:

use varlink_derive;

varlink_derive::varlink!(org_example_ping, r#"
interface org.example.ping

method Ping(ping: string) -> (pong: string)
"#);

use crate::org_example_ping::VarlinkClientInterface;
/* ... */
use varlink_derive;

varlink_derive::varlink_file!(
   org_example_network,
   "examples/example/src/org.example.network.varlink"
);

use crate::org_example_network::VarlinkClientInterface;
/* ... */

Dependencies

~3MB
~53K SLoC