pub struct StackMetadata {Show 15 fields
pub stack_id: Uuid,
pub name: String,
pub description: Option<String>,
pub base_branch: String,
pub current_branch: Option<String>,
pub total_commits: usize,
pub submitted_commits: usize,
pub merged_commits: usize,
pub branches: Vec<String>,
pub commit_hashes: Vec<String>,
pub has_conflicts: bool,
pub is_up_to_date: bool,
pub last_sync: Option<DateTime<Utc>>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
High-level metadata for a stack
Fields§
§stack_id: UuidStack ID
name: StringStack name
description: Option<String>Stack description
base_branch: StringBase branch for this stack
current_branch: Option<String>Current active branch in the stack
total_commits: usizeTotal number of commits in the stack
submitted_commits: usizeNumber of submitted commits
merged_commits: usizeNumber of merged commits
branches: Vec<String>All branches associated with this stack
commit_hashes: Vec<String>All commit hashes in this stack (in order)
has_conflicts: boolWhether this stack has conflicts
is_up_to_date: boolWhether this stack is up to date with base
last_sync: Option<DateTime<Utc>>Last time this stack was synced
created_at: DateTime<Utc>When this stack was created
updated_at: DateTime<Utc>When this stack was last updated
Implementations§
Source§impl StackMetadata
impl StackMetadata
Sourcepub fn new(
stack_id: Uuid,
name: String,
base_branch: String,
description: Option<String>,
) -> Self
pub fn new( stack_id: Uuid, name: String, base_branch: String, description: Option<String>, ) -> Self
Create new stack metadata
Sourcepub fn update_stats(&mut self, total: usize, submitted: usize, merged: usize)
pub fn update_stats(&mut self, total: usize, submitted: usize, merged: usize)
Update commit statistics
Sourcepub fn add_branch(&mut self, branch: String)
pub fn add_branch(&mut self, branch: String)
Add a branch to this stack
Sourcepub fn remove_branch(&mut self, branch: &str)
pub fn remove_branch(&mut self, branch: &str)
Remove a branch from this stack
Sourcepub fn set_current_branch(&mut self, branch: Option<String>)
pub fn set_current_branch(&mut self, branch: Option<String>)
Set the current active branch
Sourcepub fn add_commit(&mut self, commit_hash: String)
pub fn add_commit(&mut self, commit_hash: String)
Add a commit hash to the stack
Sourcepub fn remove_commit(&mut self, commit_hash: &str)
pub fn remove_commit(&mut self, commit_hash: &str)
Remove a commit hash from the stack
Sourcepub fn set_conflicts(&mut self, has_conflicts: bool)
pub fn set_conflicts(&mut self, has_conflicts: bool)
Mark stack as having conflicts
Sourcepub fn set_up_to_date(&mut self, is_up_to_date: bool)
pub fn set_up_to_date(&mut self, is_up_to_date: bool)
Mark stack sync status
Sourcepub fn completion_percentage(&self) -> f64
pub fn completion_percentage(&self) -> f64
Get completion percentage (submitted/total)
Sourcepub fn merge_percentage(&self) -> f64
pub fn merge_percentage(&self) -> f64
Get merge percentage (merged/total)
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if the stack is complete (all commits submitted)
Sourcepub fn is_fully_merged(&self) -> bool
pub fn is_fully_merged(&self) -> bool
Check if the stack is fully merged
Trait Implementations§
Source§impl Clone for StackMetadata
impl Clone for StackMetadata
Source§fn clone(&self) -> StackMetadata
fn clone(&self) -> StackMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StackMetadata
impl Debug for StackMetadata
Source§impl<'de> Deserialize<'de> for StackMetadata
impl<'de> Deserialize<'de> for StackMetadata
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>,
Auto Trait Implementations§
impl Freeze for StackMetadata
impl RefUnwindSafe for StackMetadata
impl Send for StackMetadata
impl Sync for StackMetadata
impl Unpin for StackMetadata
impl UnsafeUnpin for StackMetadata
impl UnwindSafe for StackMetadata
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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