Skip to content

Allow pub visibility as an option #361

@louwenus

Description

@louwenus

I would like, eventually as an option, to make the .project method and ProjectionRef struct public

My use case is a user-defined callback, tacking as argument a Pin<&mut MyStruct>

MyStruct have some structurally pinned fields that the user probably do not want to touch, but also regular fields designed to be modified by the user, and I do not want to pass them directly to the user (aka, projecting on the library side) to allow the user to call the method defined on Pin<&mut MyStruct> (which need some of the structurally pinned fields)

It may be good idea to require the use of the project = SomeName option in that case, and maybe a way to add doc to the ProjectRef and the project method (or a good default doc)

However, as they are both tagged doc(hidden), it may be just as easy to just make them follow the visibility of the item they are defined on (in case there is another reason besside not appearing in the doc i am glad to hear it)

I would be happy to make a PR for whatever behavior you think is best! (in the meantime, I think I will use a personal fork where I implement the easier "follow whatever the item visibility is" option)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: A new feature or an improvement for an existing one

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions