Expand description

A common backend for bindgen crates.

This (internal) crate provides functionality common to multiple bindgen dependency crates. There are 4 main things exported from this crate:

  1. TryToTokens

    Provides the ability to attempt conversion from an AST struct into a TokenStream

  2. Diagnostic

    A struct used to provide diagnostic responses for failures of said tokenization

  3. ast

    Abstract Syntax Tree types used to represent a Rust program, with the necessary metadata to generate bindings for it

  4. util

    Common utilities for manipulating parsed types from syn

Modules

A representation of the Abstract Syntax Tree of a Rust program, with all the added metadata necessary to generate WASM bindings for it.

Common utility function for manipulating syn types and handling parsed values

Macros

Immediately fail and return an Err, with the arguments passed to err_span!

Provide a Diagnostic with the given span and message

Structs

A struct representing a diagnostic to emit to the end-user as an error.

Traits

A trait for converting AST structs into Tokens and adding them to a TokenStream, or providing a diagnostic if conversion fails.