#parser #ipc #varlink #rpc #protocols

varlink_parser

A crate for parsing varlink interface definition files

30 releases (17 stable)

4.2.0 Dec 7, 2021
4.1.0 Mar 9, 2021
4.0.4 Jun 3, 2020
4.0.3 Nov 14, 2019
0.3.0 Mar 24, 2018

#2816 in Parser implementations


Used in 4 crates (2 directly)

MIT/Apache

51KB
1.5K SLoC

varlink_parser

varlink_parser is a rust crate for parsing varlink interface definition files.

Build Status Crate

More Info


lib.rs:

varlink_parser crate for parsing varlink interface definition files.

Examples

use varlink_parser::IDL;
use std::convert::TryFrom;
let interface = IDL::try_from("
## The Varlink Service Interface is provided by every varlink service. It
## describes the service and the interfaces it implements.
interface org.varlink.service

## Get a list of all the interfaces a service provides and information
## about the implementation.
method GetInfo() -> (
vendor: string,
product: string,
version: string,
url: string,
interfaces: []string
)

## Get the description of an interface that is implemented by this service.
method GetInterfaceDescription(interface: string) -> (description: string)

## The requested interface was not found.
error InterfaceNotFound (interface: string)

## The requested method was not found
error MethodNotFound (method: string)

## The interface defines the requested method, but the service does not
## implement it.
error MethodNotImplemented (method: string)

## One of the passed parameters is invalid.
error InvalidParameter (parameter: string)
").unwrap();
   assert_eq!(interface.name, "org.varlink.service");

Dependencies

~150–410KB