[][src]Struct kube::api::Object

pub struct Object<P, U> where
    P: Clone,
    U: Clone
{ pub types: TypeMeta, pub metadata: ObjectMeta, pub spec: P, pub status: Option<U>, }

A standard kubernetes object with .spec and .status

This is used instead of a full struct for Deployment, Pod, Node, CRD, ... Kubernetes' API generally exposes core structs in this manner, but sometimes the status, U, is missing, and is therefore wrapped in Option.

The reasons we use this wrapper rather than the actual structs are:

  • metadata field requirement for generic Informers is impossible (no field level traits)
  • you cannot implement traits for objects you don't own => no addon traits to k8s-openapi

This struct appears in ObjectList and WatchEvent, and when using a Reflector, and is exposed as the values in ObjectMap.

Fields

types: TypeMetametadata: ObjectMeta

Resource metadata

Contains information common to most resources about the Resource, including the object name, annotations, labels and more.

spec: P

The Spec struct of a resource. I.e. PodSpec, DeploymentSpec, etc.

This defines the desired state of the Resource as specified by the user.

status: Option<U>

The Status of a resource. I.e. PotStatus, DeploymentStatus, etc.

This publishes the state of the Resource as observed by the controller. Internally passed as Option<()> when a status does not exist.

Trait Implementations

impl<P, U> KubeObject for Object<P, U> where
    P: Clone,
    U: Clone
[src]

Blanked implementation for standard objects that can use Object

impl<P: Clone, U: Clone> Clone for Object<P, U> where
    P: Clone,
    U: Clone
[src]

impl<P, U> Serialize for Object<P, U> where
    P: Clone,
    U: Clone,
    P: Serialize,
    U: Serialize
[src]

impl<'de, P, U> Deserialize<'de> for Object<P, U> where
    P: Clone,
    U: Clone,
    P: Deserialize<'de>,
    U: Deserialize<'de>,
    U: Default
[src]

Auto Trait Implementations

impl<P, U> Send for Object<P, U> where
    P: Send,
    U: Send

impl<P, U> Sync for Object<P, U> where
    P: Sync,
    U: Sync

impl<P, U> Unpin for Object<P, U> where
    P: Unpin,
    U: Unpin

impl<P, U> UnwindSafe for Object<P, U> where
    P: UnwindSafe,
    U: UnwindSafe

impl<P, U> RefUnwindSafe for Object<P, U> where
    P: RefUnwindSafe,
    U: RefUnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]