A wrapper around accessing different values from a VCS config
| 5 | |
| 6 | /// A wrapper around accessing different values from a VCS config |
| 7 | pub trait Vcs { |
| 8 | /// # Errors |
| 9 | /// |
| 10 | /// If we can't read the config entries |
| 11 | fn entries(&self, glob: Option<&str>) -> Result<Vec<String>>; |
| 12 | /// # Errors |
| 13 | /// |
| 14 | /// If we can't read the config, or it's not parsable into a bool |
| 15 | fn get_bool(&self, name: &str) -> Result<Option<bool>>; |
| 16 | /// # Errors |
| 17 | /// |
| 18 | /// If we can't read the config, or it's not parsable into a &str |
| 19 | fn get_str(&self, name: &str) -> Result<Option<&str>>; |
| 20 | /// # Errors |
| 21 | /// |
| 22 | /// If we can't read the config, or it's not parsable into an i64 |
| 23 | fn get_i64(&self, name: &str) -> Result<Option<i64>>; |
| 24 | /// # Errors |
| 25 | /// |
| 26 | /// If the config fails to write |
| 27 | fn set_str(&mut self, name: &str, value: &str) -> Result<()>; |
| 28 | /// # Errors |
| 29 | /// |
| 30 | /// If the config fails to write |
| 31 | fn set_i64(&mut self, name: &str, value: i64) -> Result<()>; |
| 32 | /// # Errors |
| 33 | /// |
| 34 | /// If the config fails to write |
| 35 | fn remove(&mut self, name: &str) -> Result<()>; |
| 36 | |
| 37 | /// The state of the repository currently |
| 38 | /// |
| 39 | /// None if there is no repository, and we only have config |
| 40 | fn state(&self) -> Option<RepoState>; |
| 41 | } |
| 42 | |
| 43 | /// State of the repository |
| 44 | #[derive(Debug, Copy, Clone)] |
nothing calls this directly
no outgoing calls
no test coverage detected