Skip to main content

Crate varlet_idl

Crate varlet_idl 

Expand description

Model, parser and writer for the Varlink interface definition language.

An Interface describes the types, methods and errors of a Varlink interface. Build one in a const context with Interface::from_static or parse one from IDL text. Its Display implementation writes it as IDL text. See Interface for an example.

The model is plain data that borrows all of its contents. A static interface borrows from static data. Generated code uses that to describe an interface without a copy of its IDL text. A parsed interface borrows from its input and from an arena.

The language is specified at https://varlink.org/Interface-Definition.

§Features

  • parse: enables Interface::parse and Arena, the parser for IDL text and the memory it stores parsed interfaces in. Code that only describes interfaces and writes them as IDL text doesn’t need it.

Modules§

arena 🔒 parse
model 🔒
The interface definition as data.
syntax 🔒
The interface definition as IDL text: parsing and writing.

Structs§

Arenaparse
Memory for the lists, nested types and doc comments of parsed interfaces.
Doc
Doc comment of a declaration, a field or an enum variant.
ErrorDef
An error declaration.
Field
A field of a struct, of method parameters, of a method reply or of an error.
FieldName
Name of a field or of an enum variant, such as thing_name.
Interface
A Varlink interface.
InterfaceName
Name of an interface in the form of a reversed domain name, such as org.example.ftp.
InvalidDoc
Doc comment text with a line break other than \n.
InvalidName
A name that breaks the naming rules of its kind.
Method
A method declaration.
Name
Name of a type, method or error, such as GetInfo.
ParseErrorparse
An interface definition that couldn’t be parsed.
Type
The type of a field.
TypeDef
A type declaration.
Variant
A value of an enum type.

Enums§

Expectedparse
What the parser expected where it found something else.
Member
A declaration of an interface.
NameKindparse
Kind of a name that breaks the naming rules.
ParseErrorKindparse
Why an interface definition couldn’t be parsed.
TypeDefKind
The body of a type declaration.
TypeKind
What a Type is, apart from being nullable.
ValidationError
An interface that breaks a rule of the specification.
ValidationErrorKind
The rule a ValidationError is about, without the names involved.