Skip to content
Discussion options

You must be logged in to vote

The statement was scoped at functionality to be implemented inside the image crate (for now). Then you can make your trait a parent of the internal PrimitiveSealed trait if you want to keep its existence fully private or a parent of Primitive if you want to choose the sealed'ness of the trait yourself. Then, you still have to provide an impl for all types that do implement Primitive, you can access the parent in any scope where P: Primitive. In some situations the compiler needs a bit of convincing (see dispatch_transform_from_sealed).

What we don't provide is a way to do this outside image. We might provide a form of visit method by such a parent trait though, where different visitors ha…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@RunDevelopment
Comment options

RunDevelopment Mar 12, 2026
Collaborator Author

@RunDevelopment
Comment options

RunDevelopment Mar 12, 2026
Collaborator Author

@fintelia
Comment options

Answer selected by 197g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants