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: enablesInterface::parseandArena, 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§
- Arena
parse - Memory for the lists, nested types and doc comments of parsed interfaces.
- Doc
- Doc comment of a declaration, a field or an enum variant.
- Error
Def - An
errordeclaration. - Field
- A field of a struct, of method parameters, of a method reply or of an error.
- Field
Name - Name of a field or of an enum variant, such as
thing_name. - Interface
- A Varlink interface.
- Interface
Name - Name of an interface in the form of a reversed domain name, such as
org.example.ftp. - Invalid
Doc - Doc comment text with a line break other than
\n. - Invalid
Name - A name that breaks the naming rules of its kind.
- Method
- A
methoddeclaration. - Name
- Name of a type, method or error, such as
GetInfo. - Parse
Error parse - An interface definition that couldn’t be parsed.
- Type
- The type of a field.
- TypeDef
- A
typedeclaration. - Variant
- A value of an enum type.
Enums§
- Expected
parse - What the parser expected where it found something else.
- Member
- A declaration of an interface.
- Name
Kind parse - Kind of a name that breaks the naming rules.
- Parse
Error Kind parse - Why an interface definition couldn’t be parsed.
- Type
DefKind - The body of a
typedeclaration. - Type
Kind - What a
Typeis, apart from being nullable. - Validation
Error - An interface that breaks a rule of the specification.
- Validation
Error Kind - The rule a
ValidationErroris about, without the names involved.