amazon-ion / ion-cli

Apache License 2.0
34 stars 15 forks source link

Add support for generating structs in Rust with code generation #66

Closed desaikd closed 6 months ago

desaikd commented 11 months ago

Add support to generate struct based on Ion Schema. This will include supporting conversion of various struct related constraints in ISL.

Following ISL constraints will be supported with struct generation:

Action Items for this implementation:

desaikd commented 11 months ago

Mappings for ISL constraints to Rust struct:

element -> SequenceStruct(creates a struct with single field that stores the sequence as a Vec) e.g.

struct Foo { value: Vec<String> }

fields -> Struct (creates a struct with given field name and value/data type pairs) e.g.

struct Foo { name: String, id: i64 }

type -> ValueStruct (creates a struct with single field that has the data type provided with type constraint) e.g.

struct Foo { value: String }
desaikd commented 6 months ago

Completed with #61 and #81