Rust


Glue supports rust as a code generation target, allowing you to generate Rust structs and enums with Serde derives.

Simply run:

shell

#Configuration

Rust generation currently supports:

yaml

When include_yaml is enabled, generated models include from_yaml/to_yaml helper methods.

#Example

For this Glue spec:

glue

...generating Rust...

shell

...will produce code similar to:

rust

#Notes

  • Optional fields are emitted as Option<T>.
  • Arrays are emitted as Vec<T>.
  • Record<K, V> is emitted as HashMap<K, V>.
  • Anonymous model type atoms currently not supported.