Struct k8_config::KubeConfig
source · pub struct KubeConfig {
pub path: PathBuf,
pub api_version: String,
pub clusters: Vec<Cluster>,
pub contexts: Vec<Context>,
pub current_context: String,
pub kind: String,
pub users: Vec<User>,
}
Fields§
§path: PathBuf
§api_version: String
§clusters: Vec<Cluster>
§contexts: Vec<Context>
§current_context: String
§kind: String
§users: Vec<User>
Implementations§
source§impl KubeConfig
impl KubeConfig
sourcepub fn from_home() -> Result<Self, ConfigError>
pub fn from_home() -> Result<Self, ConfigError>
read from default home directory
pub fn from_file<T: AsRef<Path>>(path: T) -> Result<Self, ConfigError>
pub fn to_file<T: AsRef<Path>>(&self, path: T) -> Result<(), ConfigError>
pub fn save(&self) -> Result<(), ConfigError>
pub fn current_context(&self) -> Option<&Context>
pub fn current_cluster(&self) -> Option<&Cluster>
pub fn current_user(&self) -> Option<&User>
pub fn put_user(&mut self, user: User) -> Option<User>
pub fn put_cluster(&mut self, cluster: Cluster) -> Option<Cluster>
pub fn put_context(&mut self, context: Context) -> Option<Context>
Trait Implementations§
source§impl Debug for KubeConfig
impl Debug for KubeConfig
source§impl Default for KubeConfig
impl Default for KubeConfig
source§fn default() -> KubeConfig
fn default() -> KubeConfig
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for KubeConfig
impl<'de> Deserialize<'de> for KubeConfig
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<KubeConfig> for KubeConfig
impl PartialEq<KubeConfig> for KubeConfig
source§fn eq(&self, other: &KubeConfig) -> bool
fn eq(&self, other: &KubeConfig) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for KubeConfig
impl Serialize for KubeConfig
impl Eq for KubeConfig
impl StructuralEq for KubeConfig
impl StructuralPartialEq for KubeConfig
Auto Trait Implementations§
impl RefUnwindSafe for KubeConfig
impl Send for KubeConfig
impl Sync for KubeConfig
impl Unpin for KubeConfig
impl UnwindSafe for KubeConfig
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.