Arnavion / k8s-openapi

Rust definitions of the resource types in the Kubernetes client API
Apache License 2.0
379 stars 41 forks source link

Does the Metadata trait need to depend on Resource? #61

Closed clux closed 4 years ago

clux commented 4 years ago

As far as I can tell from the docs on the Metadata, the impls do not seem to require the associated constants from Resource.

I have a two part generic Object<Spec, Status> that I would like to implement Metadata for, but am unable to, because it forces me to impl Resource for it, and that information is propagated down later.

Arnavion commented 4 years ago

As the docs say:

I don't understand how "that information is propagated down later" will help you, given that implementing a trait like Resource is a type-system concern, not something you do dynamically. ie there is no "later".

(We can continue the discussion in https://github.com/clux/kube-rs/pull/157 )

clux commented 4 years ago

I don't understand how "that information is propagated down later" will help you, given that implementing a trait like Resource is a type-system concern, not something you do dynamically. ie there is no "later".

Crap, you're right I'm sorry. Will need to look at a derive based setup instead instead of keeping this abstraction.