pub struct ApiResource {
    pub group: String,
    pub version: String,
    pub api_version: String,
    pub kind: String,
    pub plural: String,
}
Expand description

Information about a Kubernetes API resource

Enough information to use it like a Resource by passing it to the dynamic Api constructors like Api::all_with and Api::namespaced_with.

Fields

group: String

Resource group, empty for core group.

version: String

group version

api_version: String

apiVersion of the resource (v1 for core group, groupName/groupVersions for other).

kind: String

Singular PascalCase name of the resource

plural: String

Plural name of the resource

Implementations

Creates an ApiResource by type-erasing a Resource

Creates an ApiResource from group, version, kind and plural name.

Creates an ApiResource from group, version and kind.

Warning

This function will guess the resource plural name. Usually, this is ok, but for CRDs with complex pluralisations it can fail. If you are getting your values from kube_derive use the generated method for giving you an ApiResource. Otherwise consider using ApiResource::from_gvk_with_plural to explicitly set the plural, or run api discovery on it via kube::discovery.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.