pub struct Config {
pub root_path: PathBuf,
pub versions_path: PathBuf,
pub cache_path: PathBuf,
}Expand description
Configuration manager for GVM
Handles configuration paths with the following priority:
- Environment variables
- Default configuration
Fields§
§root_path: PathBufRoot directory for GVM installation
versions_path: PathBufDirectory containing installed Go versions
cache_path: PathBufDirectory for cached downloads
Implementations§
Source§impl Config
impl Config
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Initialize configuration from environment variables and defaults Creates a new configuration.
§Errors
Returns an error if the configuration directories cannot be created.
Sourcepub fn ensure_directories(&self) -> Result<()>
pub fn ensure_directories(&self) -> Result<()>
Ensure all configuration directories exist Ensure that required directories exist.
§Errors
Returns an error if the directories cannot be created.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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