Skip to content

[EPIC] Remove all pub field accessor. #3172

Open
0 of 1 issue completed
Open

Description

@blackmwk

What's the feature are you trying to implement?

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.

Willingness to contribute

None

Activity

  1. comphead commented on Sep 28, 2026

    @comphead
    Collaborator

    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

  2. blackmwk commented on Sep 29, 2026

    @blackmwk
    ContributorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    epicEpic issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions