pub struct Context {
    pub name: String,
    pub cluster: String,
    pub namespace: Option<String>,
    pub user: String,
}
Expand description

A context represents a mapping between known users in the users set and servers in the clusters set. By looking them up here

Note: The context struct is flattened when compared to its representation in the yaml file. There is no context mapping, the values of the context mapping are directly accessible on the Context struct.

Fields

name: String

The name given to this context by the user

cluster: String

The cluster name this context refers to

namespace: Option<String>

The default namespace to use with this context

user: String

The user name this cluster refers to

Implementations

Gets the Cluster object associated with this context if it exists in the provided config object.

Gets the User object associated with this context if it exists in the provided config object.

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

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.