-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
need impl Metadata for PodTemplateSpec #157
Comments
Correct. If we want a trait for "any type that has a What exactly is the function you want to write that should work with |
I'm attempting to write traits that look like this:
In most cases where I am adding annotations (or other attributes, this is just a short example) I want to add them to the |
I wonder if it would be better to discard my |
You can either ditch the builder trait idea and make it a fn that takes
... or you can keep the trait idea but impl it for
... or keep your original trait and impl it for individual concrete types that you want to use it with. |
I'm attempting to write code that is generic over types that implement
k8s_openapi::Metadata<Ty = ObjectMeta>
.PodTemplateSpec
could fit into this category but doesn't. When I try to write an impl of my trait with a bound onk8s_openapi::Metadata
AND try to impl it directly forPodTemplateSpec
, I get a compiler error indicating not that there is an existing implementation conflict, but that there could in a future release be animpl Metadata<Ty = ObjectMeta> for PodTemplateSpec
, which doesn't leave me with any particularly good options other than to discard the implementation of my trait bounded by this crate'sMetadata
and instead write discrete impls for each type that I use...or write my own macro for it.I think the simplest solution for me would be if it were possible to generate an
impl Metadata for PodTemplateSpec
in this crate. Is that something the maintainers would be open to? It's not obvious to me where this should go since the existingimpl Metadata for <TYPE>
seems to be based on top-level k8s API objects that have an api version, kind, group, etc. Otherwise I would have just opened a PR right away.The text was updated successfully, but these errors were encountered: