Skip to main content

Vcs

Trait Vcs 

Source
pub trait Vcs {
    // Required methods
    fn entries(&self, glob: Option<&str>) -> Result<Vec<String>>;
    fn get_bool(&self, name: &str) -> Result<Option<bool>>;
    fn get_str(&self, name: &str) -> Result<Option<&str>>;
    fn get_i64(&self, name: &str) -> Result<Option<i64>>;
    fn set_str(&mut self, name: &str, value: &str) -> Result<()>;
    fn set_i64(&mut self, name: &str, value: i64) -> Result<()>;
    fn remove(&mut self, name: &str) -> Result<()>;
    fn state(&self) -> Option<RepoState>;
}
Expand description

A wrapper around accessing different values from a VCS config

Required Methods§

Source

fn entries(&self, glob: Option<&str>) -> Result<Vec<String>>

§Errors

If we can’t read the config, or it’s not parsable into a bool

Source

fn get_bool(&self, name: &str) -> Result<Option<bool>>

§Errors

If we can’t read the config, or it’s not parsable into a bool

Source

fn get_str(&self, name: &str) -> Result<Option<&str>>

§Errors

If we can’t read the config, or it’s not parsable into a &str

Source

fn get_i64(&self, name: &str) -> Result<Option<i64>>

§Errors

If we can’t read the config, or it’s not parsable into an i64

Source

fn set_str(&mut self, name: &str, value: &str) -> Result<()>

§Errors

If the config fails to write

Source

fn set_i64(&mut self, name: &str, value: i64) -> Result<()>

§Errors

If the config fails to write

Source

fn remove(&mut self, name: &str) -> Result<()>

§Errors

If the config fails to write

Source

fn state(&self) -> Option<RepoState>

The state of the repository currently

None if there is no repository, and we only have config

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Vcs for Git2

Source§

impl Vcs for InMemory<'_>