pub trait CustomResourceExt {
// Required methods
fn crd() -> CustomResourceDefinition;
fn crd_name() -> &'static str;
fn api_resource() -> ApiResource;
fn shortnames() -> &'static [&'static str];
}
Expand description
Extension trait that is implemented by kube-derive
Required Methods§
Sourcefn crd() -> CustomResourceDefinition
fn crd() -> CustomResourceDefinition
Helper to generate the CRD including the JsonSchema
This is using the stable v1::CustomResourceDefinitions (present in kubernetes >= 1.16)
Sourcefn crd_name() -> &'static str
fn crd_name() -> &'static str
Helper to return the name of this CustomResourceDefinition
in kubernetes.
This is not the name of an instance of this custom resource but the CustomResourceDefinition
object itself.
Sourcefn api_resource() -> ApiResource
fn api_resource() -> ApiResource
Helper to generate the api information type for use with the dynamic Api
Sourcefn shortnames() -> &'static [&'static str]
fn shortnames() -> &'static [&'static str]
Shortnames of this resource type.
For example: Pod
has the shortname alias po
.
NOTE: This function returns declared short names (at compile-time, using the #[kube(shortname = "foo")]
), not the
shortnames registered with the Kubernetes API (which is what tools such as kubectl
look at).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.