pub trait ResourceExt: Resource {
Show 15 methods
fn name(&self) -> String;
fn namespace(&self) -> Option<String>;
fn resource_version(&self) -> Option<String>;
fn uid(&self) -> Option<String>;
fn creation_timestamp(&self) -> Option<Time>;
fn labels(&self) -> &BTreeMap<String, String>;
fn labels_mut(&mut self) -> &mut BTreeMap<String, String>;
fn annotations(&self) -> &BTreeMap<String, String>;
fn annotations_mut(&mut self) -> &mut BTreeMap<String, String>;
fn owner_references(&self) -> &[OwnerReference];
fn owner_references_mut(&mut self) -> &mut Vec<OwnerReference, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
;
fn finalizers(&self) -> &[String];
fn finalizers_mut(&mut self) -> &mut Vec<String, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
;
fn managed_fields(&self) -> &[ManagedFieldsEntry];
fn managed_fields_mut(&mut self) -> &mut Vec<ManagedFieldsEntry, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
;
}
client
only.Expand description
Helper methods for resources.
Required Methods
Returns the name of the resource, panicking if it is
missing. Use this function if you know that name is set, for example
when resource was received from the apiserver.
Because of .metadata.generateName
field, in other contexts name
may be missing.
For non-panicking alternative, you can directly read name
field
on the self.meta()
.
fn resource_version(&self) -> Option<String>
fn resource_version(&self) -> Option<String>
The resource version
Unique ID (if you delete resource and then create a new resource with the same name, it will have different ID)
fn creation_timestamp(&self) -> Option<Time>
fn creation_timestamp(&self) -> Option<Time>
Returns the creation timestamp
This is guaranteed to exist on resources received by the apiserver.
fn labels_mut(&mut self) -> &mut BTreeMap<String, String>
fn labels_mut(&mut self) -> &mut BTreeMap<String, String>
Provides mutable access to the labels
fn annotations(&self) -> &BTreeMap<String, String>
fn annotations(&self) -> &BTreeMap<String, String>
Returns resource annotations
fn annotations_mut(&mut self) -> &mut BTreeMap<String, String>
fn annotations_mut(&mut self) -> &mut BTreeMap<String, String>
Provider mutable access to the annotations
fn owner_references(&self) -> &[OwnerReference]
fn owner_references(&self) -> &[OwnerReference]
Returns resource owner references
Provides mutable access to the owner references
fn finalizers(&self) -> &[String]
fn finalizers(&self) -> &[String]
Returns resource finalizers
Provides mutable access to the finalizers
fn managed_fields(&self) -> &[ManagedFieldsEntry]
fn managed_fields(&self) -> &[ManagedFieldsEntry]
Returns managed fields