[][src]Crate frunk_proc_macro_helpers

Frunk Proc Macro internals

This library holds common logic for procedural macros used by frunk

Links:

  1. Source on Github
  2. Crates.io page

Structs

FieldBinding
FieldBindings

Represents the binding of a struct or enum variant's fields to a corresponding set of similarly named local variables.

VariantBinding
VariantBindings

Enums

StructType

Functions

build_coprod_constr

Given an index and an expression or pattern, creates an AST for the corresponding Coproduct constructor, which may itself be used as an expression or a pattern.

build_coprod_type

Given a list of types, creates an AST for the corresponding Coproduct type.

build_coprod_unreachable_arm

Given the length of a Coproduct type, generates an "unreachable" match arm, matching the CNil case in order to work around limitations in the compiler's exhaustiveness checking.

build_field_expr
build_field_pat
build_field_type
build_hlist_constr

Given a list of expressions or patterns, creates an AST for the corresponding HList constructor, which may itself be used as an expression or a pattern.

build_hlist_type

Given a list of types, creates an AST for the corresponding HList type.

build_label_type

Given an Ident returns an AST for its type level representation based on the enums generated in frunk_core::labelled.

build_path_type
call_site_ident

Returns an Ident

find_idents_in_expr

Returns the idents in a path like expression in reverse

ref_generics
to_ast

Parses a TokenStream (usually received as input into a custom derive function), into a syn MacroInput AST, which is nice.