Skip to main content

Flow

Derive Macro Flow 

Source
#[derive(Flow)]
{
    // Attributes available to this derive:
    #[flow]
}
Expand description

Derive the Flow trait for a struct or enum.

§Container attributes

  • #[flow(rename = "..")] — Override the Flow type name
  • #[flow(rename_all = "..")] — Rename all fields (camelCase, snake_case, etc.)
  • #[flow(export)] — Generate a test that exports this type to disk
  • #[flow(export_to = "..")] — Custom export path
  • #[flow(opaque)] — Emit as declare export opaque type Name (fully opaque)
  • #[flow(opaque = "string")] — Emit as declare export opaque type Name: string (bounded)
  • #[flow(tag = "..")] — Tagged enum representation
  • #[flow(content = "..")] — Content field for adjacently tagged enums
  • #[flow(untagged)] — Untagged enum
  • #[flow(bound = "..")] — Additional where clause bounds

§Field attributes

  • #[flow(rename = "..")] — Rename this field
  • #[flow(type = "..")] — Override field type
  • #[flow(skip)] — Skip this field
  • #[flow(optional)] — Mark as optional
  • #[flow(inline)] — Inline the field type definition
  • #[flow(flatten)] — Flatten nested fields into parent