Replies: 2 comments 4 replies
-
This is imo annoying to deal with though, lots of boxing, and you have to downcast to get the original implementor of the trait back. You can alternatively give yourself a way to pack, and unpack all the |
Beta Was this translation helpful? Give feedback.
-
Depending on what you actually need to do with the resources, you could create your own trait and implement them for the foreign types (the actual resource objects) depending on your specific object interaction and interpretation requirements. You don't need to use the |
Beta Was this translation helpful? Give feedback.
-
I have some code that takes some configuration, and is supposed to return a list of kubernetes resources to create (or replace). The code can create different resources and varying number of resources, depending on the config.
I've tried creating a
Vec
ofResource
, but my Rust skills are not up for the task of figuring out how to do such a thing. I have tried looking for some other way to do this, but I keep comming up short.Any pointers for how to approach this?
Am I doing something weird, and there is a completely different approach that would work better in Rust?
PS. I'm fairly new to Rust, but have many years of Java, Go and Python experience.
Beta Was this translation helpful? Give feedback.
All reactions