[][src]Struct git_global::Config

pub struct Config {
    pub basedir: String,
    pub ignored_patterns: Vec<String>,
    pub cache_file: PathBuf,
}

A container for git-global configuration options.

Fields

basedir: String

The base directory to walk when searching for git repositories.

ignored_patterns: Vec<String>

Path patterns to ignore when searching for git repositories.

cache_file: PathBuf

Path a cache file for git-global's usage.

Methods

impl Config[src]

pub fn new() -> Config[src]

Create a new Config with the default behavior, first checking global git config options in ~/.gitconfig, then using defaults:

  • basedir: global.basedir, or user's home directory
  • ignored_patterns: global.ignore, or nothing
  • cache_file: repos.txt in the user's XDG cache directory

pub fn get_repos(&mut self) -> Vec<Repo>[src]

Returns all known git repos, populating the cache first, if necessary.

pub fn clear_cache(&mut self)[src]

Clears the cache of known git repos, forcing a re-scan on the next get_repos() call.

Auto Trait Implementations

impl Send for Config

impl Sync for Config

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]