pub struct Workspace { /* private fields */ }Expand description
An open workspace: its root, .omgbase/ directory, database path and
store.
Implementations§
Source§impl Workspace
impl Workspace
Sourcepub fn open(root: impl AsRef<Path>) -> Result<Self>
pub fn open(root: impl AsRef<Path>) -> Result<Self>
Open the workspace rooted exactly at root, creating .omgbase/ and
the database as needed.
Sourcepub fn open_with_minter(
root: impl AsRef<Path>,
minter: Box<dyn IdMinter>,
) -> Result<Self>
pub fn open_with_minter( root: impl AsRef<Path>, minter: Box<dyn IdMinter>, ) -> Result<Self>
Workspace::open with a replaceable id minter (spec/store §2.2).
Sourcepub fn find(start: &Path) -> Result<Option<Self>>
pub fn find(start: &Path) -> Result<Option<Self>>
The workspace containing start (walk up), or None.
Sourcepub fn locate(explicit: Option<&Path>, start: &Path) -> Result<Option<Self>>
pub fn locate(explicit: Option<&Path>, start: &Path) -> Result<Option<Self>>
§1 precedence: an explicit --workspace value, else
$OMGBASE_WORKSPACE, else discovery from start.
pub fn root(&self) -> &Path
Sourcepub fn omgbase_dir(&self) -> &Path
pub fn omgbase_dir(&self) -> &Path
<root>/.omgbase — where the locks live (§7).
pub fn db_path(&self) -> &Path
pub fn store(&self) -> &Store
pub fn store_mut(&mut self) -> &mut Store
pub fn repo_by_slug(&self, slug: &str) -> Result<Option<RepoRow>>
Sourcepub fn select_repo(&self, cwd: &Path, slug: Option<&str>) -> Result<RepoRow>
pub fn select_repo(&self, cwd: &Path, slug: Option<&str>) -> Result<RepoRow>
select_repo over this workspace’s repos.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Workspace
impl !RefUnwindSafe for Workspace
impl !Send for Workspace
impl !Sync for Workspace
impl !UnwindSafe for Workspace
impl Unpin for Workspace
impl UnsafeUnpin for Workspace
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