Skip to main content

Module parser_builder

Module parser_builder 

Source
Expand description

Reads the model!{} DSL out of a Rust source file into a ParsedSchema. The DSL itself is parsed by runique_dsl, the same parser the model!{} macro uses, so a model the macro refuses is refused here too.

Structs§

ParsedModel
A model!{} read for migrations: its table, and the tables of its list fields (checkbox / multichoice).

Functions§

parse_model_from_source
Same as parse_schema_from_source, with the list fields’ tables.
parse_schema_from_source
Parses the model!{} invocation of a Rust source file and returns the model’s snake_case name together with its ParsedSchema. Ok(None) when the file has no model!{}; an error when the file isn’t valid Rust, when the model doesn’t parse, or when the file declares more than one model.