[][src]Crate varlink_parser

varlink_parser crate for parsing varlink interface definition files.

Examples

use varlink_parser::IDL;
let interface = IDL::from_string("
# 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");

Structs

Argument
Error
IDL
Method
Typedef
VEnum
VError
VStruct

Enums

VStructOrEnum
VType
VTypeExt

Traits

Format
FormatColored