pub struct Config {
pub repositories: HashMap<String, RepositoryEntry>,
pub directories: HashMap<String, DirectoryEntry>,
}Expand description
Configuration data for the application, including registered repositories and directories.
Fields§
§repositories: HashMap<String, RepositoryEntry>A map of repository names to their entries.
directories: HashMap<String, DirectoryEntry>A map of directory names to their entries.
Implementations§
Source§impl Config
impl Config
Sourcepub fn load(path: InputArg) -> Result<Self>
pub fn load(path: InputArg) -> Result<Self>
Loads the configuration from the default config file.
Sourcepub fn register(&mut self, path: &Path) -> Result<()>
pub fn register(&mut self, path: &Path) -> Result<()>
Registers a path as a repository or directory.
If the path is a Git repository, it is added to the repositories map. If the path is a directory containing repositories, it is added to the directories map.
Sourcepub fn unregister(&mut self, path: &PathBuf) -> Result<()>
pub fn unregister(&mut self, path: &PathBuf) -> Result<()>
Unregisters a repository or directory.
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>,
Deserialize this value from the given Serde deserializer. Read more
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
Mutably borrows from an owned value. Read more
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