pub struct ConfigFile {
pub cache: Option<CacheConfig>,
pub clouds: Option<HashMap<String, CloudConfig>>,
pub public_clouds: Option<HashMap<String, CloudConfig>>,
}Expand description
ConfigFile structure.
Fields§
§cache: Option<CacheConfig>Cache configuration.
clouds: Option<HashMap<String, CloudConfig>>clouds configuration.
public_clouds: Option<HashMap<String, CloudConfig>>vendor clouds information (profiles).
Implementations§
Source§impl ConfigFile
impl ConfigFile
Sourcepub fn builder() -> ConfigFileBuilder
pub fn builder() -> ConfigFileBuilder
A builder to create a ConfigFile by specifying which files to load.
Sourcepub fn new_with_user_specified_configs(
clouds: Option<impl AsRef<Path>>,
secure: Option<impl AsRef<Path>>,
) -> Result<Self, ConfigError>
pub fn new_with_user_specified_configs( clouds: Option<impl AsRef<Path>>, secure: Option<impl AsRef<Path>>, ) -> Result<Self, ConfigError>
Create a ConfigFile which also loads the default sources in the following order:
clouds-public.{yaml,yml,json}(seefind_vendor_filefor search paths)clouds.{yaml,yml,json}(seefind_clouds_filefor search paths)- the provided clouds file
secure.{yaml,yml,json}(seefind_secure_filefor search paths)- the provided secure file
If a source is not a valid config it will be ignored, but if one of the sources
has syntax errors (YAML/JSON) or one of the user specified configs does not
exist, a ConfigError will be returned.
Sourcepub fn new() -> Result<Self, ConfigError>
pub fn new() -> Result<Self, ConfigError>
A convenience function which calls new_with_user_specified_configs without an
additional clouds or secret file.
Sourcepub fn get_cloud_config<S: AsRef<str>>(
&self,
cloud_name: S,
) -> Result<Option<CloudConfig>, ConfigError>
pub fn get_cloud_config<S: AsRef<str>>( &self, cloud_name: S, ) -> Result<Option<CloudConfig>, ConfigError>
Get cloud connection configuration by name.
This method does not raise exception when the cloud is not found.
Sourcepub fn is_auth_cache_enabled(&self) -> bool
pub fn is_auth_cache_enabled(&self) -> bool
Return true if auth caching is enabled.
Sourcepub fn get_available_clouds(&self) -> Vec<String>
pub fn get_available_clouds(&self) -> Vec<String>
Return list of available cloud connections.
Trait Implementations§
Source§impl Clone for ConfigFile
impl Clone for ConfigFile
Source§fn clone(&self) -> ConfigFile
fn clone(&self) -> ConfigFile
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConfigFile
impl Debug for ConfigFile
Source§impl<'de> Deserialize<'de> for ConfigFile
impl<'de> Deserialize<'de> for ConfigFile
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
Auto Trait Implementations§
impl Freeze for ConfigFile
impl RefUnwindSafe for ConfigFile
impl Send for ConfigFile
impl Sync for ConfigFile
impl Unpin for ConfigFile
impl UnwindSafe for ConfigFile
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more