You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With more and more features introduced, we found one common requirement: we need to ensure that when a struct instance has been built, we need to ensure that it's valid. Some structs expose pub field accessors directly, which makes maintaining the guarantee infeasible. We need to remove all pub accessors of those struct.
Adding usually easier than to remove. Before removing we need to make sure those pubs are not used by downstream/users. One thing is to use something like
#[deprecated(note = "the method modifier may change soon")]
Let it live for release or two, and change the modifier
Adding usually easier than to remove. Before removing we need to make sure those pubs are not used by downstream/users. One thing is to use something like
#[deprecated(note = "the method modifier may change soon")]
Let it live for release or two, and change the modifier
Hi, @comphead This is a good suggestion in most case for migrating apis, but not suitable in this case, since pub accessor is going to break the guarantee that a constructed structs is always valid.
Activity
comphead commentedon Sep 28, 2026
Adding usually easier than to remove. Before removing we need to make sure those pubs are not used by downstream/users. One thing is to use something like
Let it live for release or two, and change the modifier
blackmwk commentedon Sep 29, 2026
Hi, @comphead This is a good suggestion in most case for migrating apis, but not suitable in this case, since pub accessor is going to break the guarantee that a constructed structs is always valid.