rust for varlink
WIP.
varlink tool installation
varlink file validator
$ cargo run --example validate examples/io_systemd_network/io.systemd.network.varlink
Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
Running `target/debug/examples/validate examples/io_systemd_network/io.systemd.network.varlink`
Syntax check passed!
interface io.systemd.network
type Netdev (ifindex: int, ifname: string)
type NetdevInfo (ifindex: int, ifname: string)
method Info(ifindex: int) -> (info: NetdevInfo)
method List() -> (netdevs: Netdev[])
error InvalidParameter (field: string)
error UnknownNetworkDevice ()
varlink rust generator
$ cargo run --example varlink-generator examples/io_systemd_network/io.systemd.network.varlink
Finished dev target in 0.0 secs
Running `target/debug/examples/varlink-generator examples/io_systemd_network/io.systemd.network.varlink`
// This file is automatically generated by the varlink rust generator
use Result;
use From;
use varlink;
use serde_json;
Example Server
and test from a new shell
$ varlink help tcp:127.0.0.1:12345/org..
# The Varlink Service Interface is provided by every varlink service.
# describes the service and the interfaces it implements.
interface org..
# Get a list of all the interfaces a service provides and information
# about the implementation.
method ->
# Get the description of an interface that is implemented by this service.
method ->
# The requested interface was not found.
error
# The requested method was not found
error
# The interface defines the requested method but the service does not
# implement it.
error
# One of the passed parameters is invalid.
error
$ varlink help tcp:127.0.0.1:12345/io..
# Provides information about network state
interface io..
$ varlink call tcp:127.0.0.1:12345/io...