Struct kube_client::api::DynamicObject
source · [−]pub struct DynamicObject {
pub types: Option<TypeMeta>,
pub metadata: ObjectMeta,
pub data: Value,
}client only.Expand description
A dynamic representation of a kubernetes object
This will work with any non-list type object.
Fields
types: Option<TypeMeta>The type fields, not always present
metadata: ObjectMetaObject metadata
data: ValueAll other keys
Implementations
sourceimpl DynamicObject
impl DynamicObject
sourcepub fn new(name: &str, resource: &ApiResource) -> DynamicObject
pub fn new(name: &str, resource: &ApiResource) -> DynamicObject
Create a DynamicObject with minimal values set from ApiResource.
sourcepub fn data(self, data: Value) -> DynamicObject
pub fn data(self, data: Value) -> DynamicObject
Attach dynamic data to a DynamicObject
sourcepub fn within(self, ns: &str) -> DynamicObject
pub fn within(self, ns: &str) -> DynamicObject
Attach a namespace to a DynamicObject
Trait Implementations
sourceimpl Clone for DynamicObject
impl Clone for DynamicObject
sourcepub fn clone(&self) -> DynamicObject
pub fn clone(&self) -> DynamicObject
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for DynamicObject
impl Debug for DynamicObject
sourceimpl<'de> Deserialize<'de> for DynamicObject
impl<'de> Deserialize<'de> for DynamicObject
sourcepub fn deserialize<__D>(
__deserializer: __D
) -> Result<DynamicObject, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<DynamicObject, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Resource for DynamicObject
impl Resource for DynamicObject
type DynamicType = ApiResource
type DynamicType = ApiResource
Type information for types that do not know their resource information at compile time. Read more
sourcepub fn group(dt: &ApiResource) -> Cow<'_, str>
pub fn group(dt: &ApiResource) -> Cow<'_, str>
Returns group of this object
sourcepub fn version(dt: &ApiResource) -> Cow<'_, str>
pub fn version(dt: &ApiResource) -> Cow<'_, str>
Returns version of this object
sourcepub fn kind(dt: &ApiResource) -> Cow<'_, str>
pub fn kind(dt: &ApiResource) -> Cow<'_, str>
Returns kind of this object
sourcepub fn api_version(dt: &ApiResource) -> Cow<'_, str>
pub fn api_version(dt: &ApiResource) -> Cow<'_, str>
Returns apiVersion of this object
sourcepub fn meta(&self) -> &ObjectMeta
pub fn meta(&self) -> &ObjectMeta
Metadata that all persisted resources must have
sourcepub fn meta_mut(&mut self) -> &mut ObjectMeta
pub fn meta_mut(&mut self) -> &mut ObjectMeta
Metadata that all persisted resources must have
sourcefn url_path(dt: &Self::DynamicType, namespace: Option<&str>) -> String
fn url_path(dt: &Self::DynamicType, namespace: Option<&str>) -> String
Creates a url path for http requests for this resource
sourcefn object_ref(&self, dt: &Self::DynamicType) -> ObjectReference
fn object_ref(&self, dt: &Self::DynamicType) -> ObjectReference
Generates an object reference for the resource
sourceimpl Serialize for DynamicObject
impl Serialize for DynamicObject
sourcepub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for DynamicObject
impl Send for DynamicObject
impl Sync for DynamicObject
impl Unpin for DynamicObject
impl UnwindSafe for DynamicObject
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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 K where
K: Resource,
impl<K> ResourceExt for K where
K: Resource,
sourcepub fn name(&self) -> String
pub fn name(&self) -> String
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. Read more
sourcepub fn resource_version(&self) -> Option<String>
pub fn resource_version(&self) -> Option<String>
The resource version
sourcepub fn uid(&self) -> Option<String>
pub fn uid(&self) -> Option<String>
Unique ID (if you delete resource and then create a new resource with the same name, it will have different ID) Read more
sourcepub fn labels_mut(&mut self) -> &mut BTreeMap<String, String>
pub fn labels_mut(&mut self) -> &mut BTreeMap<String, String>
Provides mutable access to the labels
sourcepub fn annotations(&self) -> &BTreeMap<String, String>
pub fn annotations(&self) -> &BTreeMap<String, String>
Returns resource annotations
sourcepub fn annotations_mut(&mut self) -> &mut BTreeMap<String, String>
pub fn annotations_mut(&mut self) -> &mut BTreeMap<String, String>
Provider mutable access to the annotations
sourcepub fn owner_references(&self) -> &[OwnerReference]
pub fn owner_references(&self) -> &[OwnerReference]
Returns resource owner references
sourcepub fn owner_references_mut(&mut self) -> &mut Vec<OwnerReference, Global>
pub fn owner_references_mut(&mut self) -> &mut Vec<OwnerReference, Global>
Provides mutable access to the owner references
sourcepub fn finalizers(&self) -> &[String]
pub fn finalizers(&self) -> &[String]
Returns resource finalizers
sourcepub fn finalizers_mut(&mut self) -> &mut Vec<String, Global>
pub fn finalizers_mut(&mut self) -> &mut Vec<String, Global>
Provides mutable access to the finalizers
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more