kube_core::object

Trait 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,

Source§

type Spec = P