palantir / conjure-rust

Conjure support for Rust
Apache License 2.0
20 stars 11 forks source link

Add setters to object codegen #304

Open sfackler opened 8 months ago

sfackler commented 8 months ago

We currently generate immutable structs for Conjure objects, and require them to be converted back into a builder to be modified. This matches the behavior of conjure-java, but feels unnecessary in Rust since it has more robust ownership and mutability semantics.

We should instead just add setters to the generated structs and leave the builders for initial construction.

sfackler commented 7 months ago

Alternatively, we could just make the fields public. That would also allow people to move out of them.