I think I finally understood: the language needs three kinds of structs:
-
cannot be constructed outside own crate so that
- new private or
-
pub
fields w/o defaults can be added
and this is not a breaking change
-
can be constructed outside own crate
using the currentS{a : b}
syntax
but adding new fields is a breaking change -
can be constructed outside own create
using the newS{a : b, ..}
syntax
but adding new fields without defaults is a breaking change
Currently Rust only has (1) and (2) which are distinguished via non_exhaustive
. But there is no way around it is there? Kind number (3) has to be provided, right? And it has to be marked somehow.