pub struct StackManager { /* private fields */ }
Expand description
Manages all stack operations and persistence
Implementations§
Source§impl StackManager
impl StackManager
Sourcepub fn new(repo_path: &Path) -> Result<Self>
pub fn new(repo_path: &Path) -> Result<Self>
Create a new StackManager for the given repository
Sourcepub fn create_stack(
&mut self,
name: String,
base_branch: Option<String>,
description: Option<String>,
) -> Result<Uuid>
pub fn create_stack( &mut self, name: String, base_branch: Option<String>, description: Option<String>, ) -> Result<Uuid>
Create a new stack
Sourcepub fn get_stack_mut(&mut self, stack_id: &Uuid) -> Option<&mut Stack>
pub fn get_stack_mut(&mut self, stack_id: &Uuid) -> Option<&mut Stack>
Get a mutable stack by ID
Sourcepub fn get_stack_by_name(&self, name: &str) -> Option<&Stack>
pub fn get_stack_by_name(&self, name: &str) -> Option<&Stack>
Get stack by name
Sourcepub fn get_stack_by_name_mut(&mut self, name: &str) -> Option<&mut Stack>
pub fn get_stack_by_name_mut(&mut self, name: &str) -> Option<&mut Stack>
Get mutable stack by name
Sourcepub fn update_stack_working_branch(
&mut self,
name: &str,
branch: String,
) -> Result<()>
pub fn update_stack_working_branch( &mut self, name: &str, branch: String, ) -> Result<()>
Update working branch for a stack
Sourcepub fn get_active_stack(&self) -> Option<&Stack>
pub fn get_active_stack(&self) -> Option<&Stack>
Get the currently active stack
Sourcepub fn get_active_stack_mut(&mut self) -> Option<&mut Stack>
pub fn get_active_stack_mut(&mut self) -> Option<&mut Stack>
Get the currently active stack mutably
Sourcepub fn set_active_stack_by_name(&mut self, name: &str) -> Result<()>
pub fn set_active_stack_by_name(&mut self, name: &str) -> Result<()>
Set active stack by name
Sourcepub fn delete_stack(&mut self, stack_id: &Uuid) -> Result<Stack>
pub fn delete_stack(&mut self, stack_id: &Uuid) -> Result<Stack>
Delete a stack
Sourcepub fn push_to_stack(
&mut self,
branch: String,
commit_hash: String,
message: String,
source_branch: String,
) -> Result<Uuid>
pub fn push_to_stack( &mut self, branch: String, commit_hash: String, message: String, source_branch: String, ) -> Result<Uuid>
Push a commit to a stack
Sourcepub fn pop_from_stack(&mut self) -> Result<StackEntry>
pub fn pop_from_stack(&mut self) -> Result<StackEntry>
Pop the top commit from the active stack
Sourcepub fn submit_entry(
&mut self,
stack_id: &Uuid,
entry_id: &Uuid,
pull_request_id: String,
) -> Result<()>
pub fn submit_entry( &mut self, stack_id: &Uuid, entry_id: &Uuid, pull_request_id: String, ) -> Result<()>
Submit a stack entry for review (mark as submitted)
Sourcepub fn repair_all_stacks(&mut self) -> Result<()>
pub fn repair_all_stacks(&mut self) -> Result<()>
Repair data consistency issues in all stacks
Sourcepub fn get_all_stacks(&self) -> Vec<&Stack>
pub fn get_all_stacks(&self) -> Vec<&Stack>
Get all stacks
Sourcepub fn get_stack_metadata(&self, stack_id: &Uuid) -> Option<&StackMetadata>
pub fn get_stack_metadata(&self, stack_id: &Uuid) -> Option<&StackMetadata>
Get stack metadata
Sourcepub fn get_repository_metadata(&self) -> &RepositoryMetadata
pub fn get_repository_metadata(&self) -> &RepositoryMetadata
Get repository metadata
Sourcepub fn git_repo(&self) -> &GitRepository
pub fn git_repo(&self) -> &GitRepository
Get the Git repository
Sourcepub fn is_in_edit_mode(&self) -> bool
pub fn is_in_edit_mode(&self) -> bool
Check if currently in edit mode
Sourcepub fn get_edit_mode_info(&self) -> Option<&EditModeState>
pub fn get_edit_mode_info(&self) -> Option<&EditModeState>
Get current edit mode information
Sourcepub fn enter_edit_mode(&mut self, stack_id: Uuid, entry_id: Uuid) -> Result<()>
pub fn enter_edit_mode(&mut self, stack_id: Uuid, entry_id: Uuid) -> Result<()>
Enter edit mode for a specific stack entry
Sourcepub fn exit_edit_mode(&mut self) -> Result<()>
pub fn exit_edit_mode(&mut self) -> Result<()>
Exit edit mode
Sourcepub fn sync_stack(&mut self, stack_id: &Uuid) -> Result<()>
pub fn sync_stack(&mut self, stack_id: &Uuid) -> Result<()>
Sync stack with Git repository state
Sourcepub fn list_stacks(
&self,
) -> Vec<(Uuid, &str, &StackStatus, usize, Option<&str>)>
pub fn list_stacks( &self, ) -> Vec<(Uuid, &str, &StackStatus, usize, Option<&str>)>
List all stacks with their status
Sourcepub fn get_all_stacks_objects(&self) -> Result<Vec<Stack>>
pub fn get_all_stacks_objects(&self) -> Result<Vec<Stack>>
Get all stacks as Stack objects for TUI
Sourcepub fn validate_all(&self) -> Result<()>
pub fn validate_all(&self) -> Result<()>
Validate all stacks including Git integrity
Sourcepub fn validate_stack(&self, stack_id: &Uuid) -> Result<()>
pub fn validate_stack(&self, stack_id: &Uuid) -> Result<()>
Validate a specific stack including Git integrity
Sourcepub fn check_for_branch_change(&mut self) -> Result<bool>
pub fn check_for_branch_change(&mut self) -> Result<bool>
Check if the user has changed branches since the stack was activated Returns true if branch change detected and user wants to proceed
Auto Trait Implementations§
impl Freeze for StackManager
impl RefUnwindSafe for StackManager
impl Send for StackManager
impl !Sync for StackManager
impl Unpin for StackManager
impl UnwindSafe for StackManager
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
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>
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>
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