pub struct Config {
pub default_enterprise: Option<String>,
pub default_cloud: Option<String>,
pub files_api_key: Option<String>,
pub profiles: HashMap<String, Profile>,
}Expand description
Main configuration structure
Fields§
§default_enterprise: Option<String>Default profile for enterprise commands
default_cloud: Option<String>Default profile for cloud commands
files_api_key: Option<String>Global Files.com API key for support package uploads Can be overridden per-profile. Supports keyring: prefix for secure storage.
profiles: HashMap<String, Profile>Map of profile name -> profile configuration
Implementations§
Source§impl Config
impl Config
Sourcepub fn find_first_profile_of_type(
&self,
deployment_type: DeploymentType,
) -> Option<&str>
pub fn find_first_profile_of_type( &self, deployment_type: DeploymentType, ) -> Option<&str>
Get the first profile of the specified deployment type (sorted alphabetically by name)
Sourcepub fn get_profiles_of_type(&self, deployment_type: DeploymentType) -> Vec<&str>
pub fn get_profiles_of_type(&self, deployment_type: DeploymentType) -> Vec<&str>
Get all profiles of the specified deployment type
Sourcepub fn resolve_enterprise_profile(
&self,
explicit_profile: Option<&str>,
) -> Result<String>
pub fn resolve_enterprise_profile( &self, explicit_profile: Option<&str>, ) -> Result<String>
Resolve the profile to use for enterprise commands
Sourcepub fn resolve_cloud_profile(
&self,
explicit_profile: Option<&str>,
) -> Result<String>
pub fn resolve_cloud_profile( &self, explicit_profile: Option<&str>, ) -> Result<String>
Resolve the profile to use for cloud commands
Sourcepub fn load_from_path(config_path: &Path) -> Result<Self>
pub fn load_from_path(config_path: &Path) -> Result<Self>
Load configuration from a specific path
Sourcepub fn save_to_path(&self, config_path: &Path) -> Result<()>
pub fn save_to_path(&self, config_path: &Path) -> Result<()>
Save configuration to a specific path
Sourcepub fn set_profile(&mut self, name: String, profile: Profile)
pub fn set_profile(&mut self, name: String, profile: Profile)
Set or update a profile
Sourcepub fn remove_profile(&mut self, name: &str) -> Option<Profile>
pub fn remove_profile(&mut self, name: &str) -> Option<Profile>
Remove a profile by name
Sourcepub fn list_profiles(&self) -> Vec<(&String, &Profile)>
pub fn list_profiles(&self) -> Vec<(&String, &Profile)>
List all profiles sorted by name
Sourcepub fn config_path() -> Result<PathBuf>
pub fn config_path() -> Result<PathBuf>
Get the path to the configuration file
On macOS, this supports both the standard macOS path and Linux-style ~/.config path:
- Check ~/.config/redisctl/config.toml (Linux-style, preferred for consistency)
- Fall back to ~/Library/Application Support/com.redis.redisctl/config.toml (macOS standard)
On Linux: ~/.config/redisctl/config.toml On Windows: %APPDATA%\redis\redisctl\config.toml
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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>,
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)