Skip to main content

Crate yog_data_derive

Crate yog_data_derive 

Source
Expand description

#[derive(Schema)] — see yog_data::Schema.

  • A struct with named fields is an object. Field attributes: #[data(rename = "name")], #[data(default)] / #[data(default = "path::to_fn")], #[data(skip)] (never read or written; Default). Option fields may be left out.
  • A struct with one unnamed field is that field’s format.
  • An enum of unit variants is a string: the variant’s name in snake_case, or #[data(rename = "...")].
  • #[data(tag = "type")] on an enum: an object whose type names the variant; a variant is a unit, has named fields, or wraps one struct whose fields sit next to the tag.

Doc comments become the shape’s docs (Yog-IDLE’s hover text and the docs’ field tables).

Derive Macros§

Schema