Skip to main content

table_from_struct

Function table_from_struct 

Source
pub fn table_from_struct(
    item: &ItemStruct,
    enums: Option<&[EnumDef]>,
) -> Result<TableDef, Error>
Expand description

Parse one #[derive(Table)] struct.

enums is the full set of known DbEnums when parsing a whole folder (CLI). Pass None in single-item contexts (the derive macro, which cannot see other items): any unknown non-json type is then assumed to be a DbEnum and DDL-only data (check_in) is left empty.