Crate wasm_bindgen_backend[][src]

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

ast

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

util

Common utility function for manipulating syn types and handling parsed values

Macros

bail_span

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

err_span

Provide a Diagnostic with the given span and message

Structs

Diagnostic

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

Traits

TryToTokens

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