Create separate templates based on `AbstractDataType` for `struct.templ`
Currently struct.templ has if statements that help render a Rust struct based on AbstractDataType value. Instead generate different modules for ease of code maintenance and reviewer's readability.
So, that is why I mentioned
WriteAsIonin one of my other comments.WriteAsIonis already implemented for primitive types and forVec<T: WriteAsIon>, and if we don't have an equivalentReadFromIonor similar, then we need to create an issue for that inion-rust.On the other hand, I think there could also be reason to use wrapper if we want to add additional validation constraints, such as
type::{ name: small_int, type: int, valid_values: range::[0, 9] }. In that case havingstruct SmallInt(u8)would actually allow us to add the range check to the type. That being said, I can't remember if we decided whether we want to ever have additional validations like that.
https://github.com/amazon-ion/ion-cli/pull/90#discussion_r1533061185