Struct gcloud_ctx::ConfigurationStore
source · [−]pub struct ConfigurationStore { /* private fields */ }
Expand description
Represents the store of gcloud configurations
Implementations
sourceimpl ConfigurationStore
impl ConfigurationStore
sourcepub fn with_default_location() -> Result<Self>
pub fn with_default_location() -> Result<Self>
Opens the configuration store using the OS-specific defaults
If the CLOUDSDK_CONFIG
environment variable is set then this will be used, otherwise an
OS-specific default location will be used, as defined by the dirs crate, e.g.:
- Windows:
%APPDATA%\gcloud
- Linux:
~/.config/gcloud
- Mac:
~/.config/gcloud
- note that this does not follow the Apple Developer Guidelines
sourcepub fn with_location(gcloud_path: PathBuf) -> Result<Self>
pub fn with_location(gcloud_path: PathBuf) -> Result<Self>
Opens a configuration store at the given path
sourcepub fn configurations(&self) -> Vec<&Configuration>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn configurations(&self) -> Vec<&Configuration>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Get the collection of currently available configurations
sourcepub fn is_active(&self, configuration: &Configuration) -> bool
pub fn is_active(&self, configuration: &Configuration) -> bool
Check if the given configuration is active
sourcepub fn copy(
&mut self,
src_name: &str,
dest_name: &str,
conflict: ConflictAction
) -> Result<()>
pub fn copy(
&mut self,
src_name: &str,
dest_name: &str,
conflict: ConflictAction
) -> Result<()>
Copy an existing configuration, preserving all properties
sourcepub fn create(
&mut self,
name: &str,
properties: &Properties,
conflict: ConflictAction
) -> Result<()>
pub fn create(
&mut self,
name: &str,
properties: &Properties,
conflict: ConflictAction
) -> Result<()>
Create a new configuration
sourcepub fn describe(&self, name: &str) -> Result<Properties>
pub fn describe(&self, name: &str) -> Result<Properties>
Describe the properties in the given configuration
sourcepub fn rename(
&mut self,
old_name: &str,
new_name: &str,
conflict: ConflictAction
) -> Result<()>
pub fn rename(
&mut self,
old_name: &str,
new_name: &str,
conflict: ConflictAction
) -> Result<()>
Rename a configuration
sourcepub fn find_by_name(&self, name: &str) -> Option<&Configuration>
pub fn find_by_name(&self, name: &str) -> Option<&Configuration>
Find a configuration by name
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ConfigurationStore
impl Send for ConfigurationStore
impl Sync for ConfigurationStore
impl Unpin for ConfigurationStore
impl UnwindSafe for ConfigurationStore
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