Name Description Size
attributes.rs # Attribute definitions for a `InterfaceCollector`. This module provides some conveniences for working with attribute definitions from WebIDL. When encountering a weedle `ExtendedAttribute` node, use `TryFrom` to convert it into an [`Attribute`] representing one of the attributes that we support. You can also use the [`parse_attributes`] function to parse an `ExtendedAttributeList` into a vec of same. We only support a small number of attributes, so it's manageable to have them all handled by a single abstraction. This might need to be refactored in future if we grow significantly more complicated attribute handling. 37958
collectors.rs # Collects metadata from UDL. 11839
converters
finder.rs # Helpers for finding the named types defined in a UDL interface. This module provides the [`TypeFinder`] trait, an abstraction for walking the weedle parse tree, looking for type definitions, and accumulating them in a [`TypeCollector`]. The type-finding process only discovers very basic information about names and their corresponding types. For example, it can discover that "Foobar" names a Record, but it won't discover anything about the fields of that record. Factoring this functionality out into a separate phase makes the subsequent work of more *detailed* parsing of the UDL a lot simpler, we know how to resolve names to types when building up the full interface definition. 11441
lib.rs # Uniffi support for webidl syntax, typically from a .udl file, as described by weedle. This library is dedicated to parsing a string in a webidl syntax, as described by weedle and with our own custom take on the attributes etc, pushing the boundaries of that syntax to describe a uniffi `MetadataGroup`. The output of this module is consumed by uniffi_bindgen to generate stuff. 1551
literal.rs 6600
resolver.rs # Helpers for resolving UDL type expressions into concrete types. This module provides the [`TypeResolver`] trait, an abstraction for walking the parse tree of a weedle type expression and using a [`TypeCollector`] to convert it into a concrete type definition (so it assumes that you're already used a [`TypeFinder`](super::TypeFinder) to populate the universe). Perhaps most importantly, it knows how to error out if the UDL tries to reference an undefined or invalid type. 10427