Struct kube_client::api::Object
source · [−]pub struct Object<P, U>where
P: Clone,
U: Clone,{
pub types: Option<TypeMeta>,
pub metadata: ObjectMeta,
pub spec: P,
pub status: Option<U>,
}
client
only.Expand description
A standard Kubernetes object with .spec
and .status
.
This is a convenience struct provided for serialization/deserialization. It is slightly stricter than [’DynamicObject`] in that it enforces the spec/status convention, and as such will not in general work with all api-discovered resources.
This can be used to tie existing resources to smaller, local struct variants to optimize for memory use. E.g. if you are only interested in a few fields, but you store tons of them in memory with reflectors.
Fields
types: Option<TypeMeta>
The type fields, not always present
metadata: 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. PodStatus
, DeploymentStatus
, etc.
This publishes the state of the Resource as observed by the controller.
Use U = NotUsed
when a status does not exist.
Implementations
Trait Implementations
sourceimpl<'de, P, U> Deserialize<'de> for Object<P, U>where
P: Clone + Deserialize<'de>,
U: Clone + Deserialize<'de> + Default,
impl<'de, P, U> Deserialize<'de> for Object<P, U>where
P: Clone + Deserialize<'de>,
U: Clone + Deserialize<'de> + Default,
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<Object<P, U>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Object<P, U>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
sourceimpl<P, U> HasStatus for Object<P, U>where
P: Clone,
U: Clone,
impl<P, U> HasStatus for Object<P, U>where
P: Clone,
U: Clone,
sourceimpl<P, U> Resource for Object<P, U>where
P: Clone,
U: Clone,
impl<P, U> Resource for Object<P, U>where
P: Clone,
U: Clone,
type DynamicType = ApiResource
type DynamicType = ApiResource
type Scope = DynamicResourceScope
type Scope = DynamicResourceScope
sourcefn group(dt: &ApiResource) -> Cow<'_, str>
fn group(dt: &ApiResource) -> Cow<'_, str>
sourcefn version(dt: &ApiResource) -> Cow<'_, str>
fn version(dt: &ApiResource) -> Cow<'_, str>
sourcefn kind(dt: &ApiResource) -> Cow<'_, str>
fn kind(dt: &ApiResource) -> Cow<'_, str>
sourcefn api_version(dt: &ApiResource) -> Cow<'_, str>
fn api_version(dt: &ApiResource) -> Cow<'_, str>
sourcefn meta(&self) -> &ObjectMeta
fn meta(&self) -> &ObjectMeta
sourcefn meta_mut(&mut self) -> &mut ObjectMeta
fn meta_mut(&mut self) -> &mut ObjectMeta
sourcefn url_path(dt: &Self::DynamicType, namespace: Option<&str>) -> String
fn url_path(dt: &Self::DynamicType, namespace: Option<&str>) -> String
sourcefn object_ref(&self, dt: &Self::DynamicType) -> ObjectReference
fn object_ref(&self, dt: &Self::DynamicType) -> ObjectReference
sourcefn controller_owner_ref(&self, dt: &Self::DynamicType) -> Option<OwnerReference>
fn controller_owner_ref(&self, dt: &Self::DynamicType) -> Option<OwnerReference>
Auto Trait Implementations
impl<P, U> RefUnwindSafe for Object<P, U>where
P: RefUnwindSafe,
U: RefUnwindSafe,
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,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<K> ResourceExt for Kwhere
K: Resource,
impl<K> ResourceExt for Kwhere
K: Resource,
sourcefn name(&self) -> String
fn name(&self) -> String
ResourceExt::name can panic and has been replaced by ResourceExt::name_any
and ResourceExt::name_unchecked
. This fn will be removed in 0.77.0.
name_unchecked