pub struct WorkspaceManager<'a> { /* private fields */ }Expand description
Manages workspace CRUD operations backed by AppDb.
Implementations§
Source§impl<'a> WorkspaceManager<'a>
impl<'a> WorkspaceManager<'a>
Sourcepub fn create_workspace(&self, name: &str) -> DbResult<Workspace>
pub fn create_workspace(&self, name: &str) -> DbResult<Workspace>
Create a new workspace with the given name.
Sourcepub fn get_workspace(&self, id: &str) -> DbResult<Workspace>
pub fn get_workspace(&self, id: &str) -> DbResult<Workspace>
Get a workspace by ID, including its projects.
Sourcepub fn list_workspaces(&self) -> DbResult<Vec<Workspace>>
pub fn list_workspaces(&self) -> DbResult<Vec<Workspace>>
List all workspaces with their projects.
Sourcepub fn delete_workspace(&self, id: &str) -> DbResult<()>
pub fn delete_workspace(&self, id: &str) -> DbResult<()>
Delete a workspace by ID. Cascades to workspace_projects.
Sourcepub fn add_project(
&self,
workspace_id: &str,
project_path: &str,
) -> DbResult<()>
pub fn add_project( &self, workspace_id: &str, project_path: &str, ) -> DbResult<()>
Add a project to a workspace. Derives the name from the path.
Auto Trait Implementations§
impl<'a> Freeze for WorkspaceManager<'a>
impl<'a> !RefUnwindSafe for WorkspaceManager<'a>
impl<'a> !Send for WorkspaceManager<'a>
impl<'a> !Sync for WorkspaceManager<'a>
impl<'a> Unpin for WorkspaceManager<'a>
impl<'a> UnsafeUnpin for WorkspaceManager<'a>
impl<'a> !UnwindSafe for WorkspaceManager<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more