wasm_bindgen_backend

Trait TryToTokens

Source
pub trait TryToTokens {
    // Required method
    fn try_to_tokens(&self, tokens: &mut TokenStream) -> Result<(), Diagnostic>;

    // Provided method
    fn try_to_token_stream(&self) -> Result<TokenStream, Diagnostic> { ... }
}
Expand description

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

Required Methods§

Source

fn try_to_tokens(&self, tokens: &mut TokenStream) -> Result<(), Diagnostic>

Attempt to convert a Self into tokens and add it to the TokenStream

Provided Methods§

Source

fn try_to_token_stream(&self) -> Result<TokenStream, Diagnostic>

Attempt to convert a Self into a new TokenStream

Implementors§