Skip to main content

HasStatus

Trait HasStatus 

Source
pub trait HasStatus {
    type Status;

    // Required methods
    fn status(&self) -> Option<&Self::Status>;
    fn status_mut(&mut self) -> &mut Option<Self::Status>;
}
Expand description

A trait to access the status of a Kubernetes resource.

Some built-in Kubernetes resources and custom resources do have a status 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 status (e.g. ConfigMap, Secret, …).

Required Associated Types§

Source

type Status

The type of the status object

Required Methods§

Source

fn status(&self) -> Option<&Self::Status>

Returns an optional reference to the status of the object

Source

fn status_mut(&mut self) -> &mut Option<Self::Status>

Returns an optional mutable reference to the status of the object

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

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