pub struct Config {
pub projects: BTreeMap<String, Project>,
}Fields§
§projects: BTreeMap<String, Project>Implementations§
Source§impl Config
impl Config
pub fn load() -> Result<Self, Error>
pub fn save(&self) -> Result<(), Error>
pub fn add_project(&mut self, name: String, path: PathBuf) -> Result<(), Error>
pub fn remove_project(&mut self, name: &str) -> Result<(), Error>
Sourcepub fn find_project_for_path(
&self,
path: &Path,
) -> Result<Option<ProjectRef>, Error>
pub fn find_project_for_path( &self, path: &Path, ) -> Result<Option<ProjectRef>, Error>
Find which project a path belongs to.
Checks in order:
- Path is a subdirectory of a project’s worktree base (more specific match)
- Path is a subdirectory of a project’s main repo
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§
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