Struct kube_core::api_resource::ApiResource [−][src]
pub struct ApiResource { pub group: String, pub version: String, pub api_version: String, pub kind: String, pub plural: String, }
Expand description
Contains information about Kubernetes API resources which is enough for working with it.
Fields
group: String
Expand description
Resource group, empty for core group.
version: String
Expand description
group version
api_version: String
Expand description
apiVersion of the resource (v1 for core group, groupName/groupVersions for other).
kind: String
Expand description
Singular PascalCase name of the resource
plural: String
Expand description
Plural name of the resource
Implementations
impl ApiResource
[src]
impl ApiResource
[src]pub fn from_apiresource(ar: &APIResource, group_version: &str) -> Self
[src]
pub fn from_apiresource(ar: &APIResource, group_version: &str) -> Self
[src]Creates ApiResource from meta::v1::APIResource
instance.
APIResource
objects can be extracted from Client::list_api_group_resources
.
If it does not specify version and/or group, they will be taken from group_version
(otherwise the second parameter is ignored).
Example usage:
use kube::api::{ApiResource, Api, DynamicObject}; let apps = client.list_api_group_resources("apps/v1").await?; for ar in &apps.resources { let resource = ApiResource::from_apiresource(ar, &apps.group_version); dbg!(&resource); let api: Api<DynamicObject> = Api::namespaced_with(client.clone(), "default", &resource); }
pub fn erase<K: Resource>(dt: &K::DynamicType) -> Self
[src]
pub fn erase<K: Resource>(dt: &K::DynamicType) -> Self
[src]Creates ApiResource by type-erasing another Resource
pub fn from_gvk(gvk: &GroupVersionKind) -> Self
[src]
pub fn from_gvk(gvk: &GroupVersionKind) -> Self
[src]Creates ApiResource from group, version and kind.
Warning
This function has to guess resource plural name. While it makes it best to guess correctly, sometimes it can be wrong, and using returned ApiResource will lead to incorrect api requests.
pub fn from_gvk_with_plural(gvk: &GroupVersionKind, plural: &str) -> Self
[src]
pub fn from_gvk_with_plural(gvk: &GroupVersionKind, plural: &str) -> Self
[src]Creates ApiResource from group, version, kind and plural name.
Trait Implementations
impl Clone for ApiResource
[src]
impl Clone for ApiResource
[src]fn clone(&self) -> ApiResource
[src]
fn clone(&self) -> ApiResource
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for ApiResource
[src]
impl Debug for ApiResource
[src]impl Hash for ApiResource
[src]
impl Hash for ApiResource
[src]impl PartialEq<ApiResource> for ApiResource
[src]
impl PartialEq<ApiResource> for ApiResource
[src]fn eq(&self, other: &ApiResource) -> bool
[src]
fn eq(&self, other: &ApiResource) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &ApiResource) -> bool
[src]
fn ne(&self, other: &ApiResource) -> bool
[src]This method tests for !=
.
impl Eq for ApiResource
[src]
impl StructuralEq for ApiResource
[src]
impl StructuralPartialEq for ApiResource
[src]
Auto Trait Implementations
impl RefUnwindSafe for ApiResource
impl Send for ApiResource
impl Sync for ApiResource
impl Unpin for ApiResource
impl UnwindSafe for ApiResource
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
pub fn equivalent(&self, key: &K) -> bool
[src]Compare self to key
and return true
if they are equal.
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more