Trait kube_core::object::HasSpec

source ·
pub trait HasSpec {
    type Spec;

    // Required methods
    fn spec(&self) -> &Self::Spec;
    fn spec_mut(&mut self) -> &mut Self::Spec;
}
Expand description

A trait to access the spec of a Kubernetes resource.

Some built-in Kubernetes resources and all custom resources do have a spec field. This trait can be used to access this field.

This trait is automatically implemented by the kube-derive macro and is not currently implemented for the Kubernetes API objects from k8s_openapi.

Note: Not all Kubernetes resources have a spec (e.g. ConfigMap, Secret, …).

Required Associated Types§

source

type Spec

The type of the spec of this resource

Required Methods§

source

fn spec(&self) -> &Self::Spec

Returns a reference to the spec of the object

source

fn spec_mut(&mut self) -> &mut Self::Spec

Returns a mutable reference to the spec of the object

Implementors§

source§

impl<P, U> HasSpec for Object<P, U>
where P: Clone, U: Clone,

§

type Spec = P