pub struct RepositoryMetadata {
pub stacks: HashMap<Uuid, StackMetadata>,
pub commits: HashMap<String, CommitMetadata>,
pub active_stack_id: Option<Uuid>,
pub default_base_branch: String,
pub edit_mode: Option<EditModeState>,
pub updated_at: DateTime<Utc>,
}
Expand description
Repository-wide stack metadata
Fields§
§stacks: HashMap<Uuid, StackMetadata>
All stacks in this repository
commits: HashMap<String, CommitMetadata>
All commit metadata
active_stack_id: Option<Uuid>
Currently active stack ID
default_base_branch: String
Default base branch for new stacks
edit_mode: Option<EditModeState>
Edit mode state
updated_at: DateTime<Utc>
When this metadata was last updated
Implementations§
Source§impl RepositoryMetadata
impl RepositoryMetadata
Sourcepub fn add_stack(&mut self, stack_metadata: StackMetadata)
pub fn add_stack(&mut self, stack_metadata: StackMetadata)
Add a stack to the repository
Sourcepub fn remove_stack(&mut self, stack_id: &Uuid) -> Option<StackMetadata>
pub fn remove_stack(&mut self, stack_id: &Uuid) -> Option<StackMetadata>
Remove a stack from the repository
Sourcepub fn get_stack(&self, stack_id: &Uuid) -> Option<&StackMetadata>
pub fn get_stack(&self, stack_id: &Uuid) -> Option<&StackMetadata>
Get a stack by ID
Sourcepub fn get_stack_mut(&mut self, stack_id: &Uuid) -> Option<&mut StackMetadata>
pub fn get_stack_mut(&mut self, stack_id: &Uuid) -> Option<&mut StackMetadata>
Get a mutable stack by ID
Sourcepub fn set_active_stack(&mut self, stack_id: Option<Uuid>)
pub fn set_active_stack(&mut self, stack_id: Option<Uuid>)
Set the active stack
Sourcepub fn get_active_stack(&self) -> Option<&StackMetadata>
pub fn get_active_stack(&self) -> Option<&StackMetadata>
Get the active stack
Sourcepub fn add_commit(&mut self, commit_metadata: CommitMetadata)
pub fn add_commit(&mut self, commit_metadata: CommitMetadata)
Add commit metadata
Sourcepub fn remove_commit(&mut self, commit_hash: &str) -> Option<CommitMetadata>
pub fn remove_commit(&mut self, commit_hash: &str) -> Option<CommitMetadata>
Remove commit metadata
Sourcepub fn get_commit(&self, commit_hash: &str) -> Option<&CommitMetadata>
pub fn get_commit(&self, commit_hash: &str) -> Option<&CommitMetadata>
Get commit metadata
Sourcepub fn get_all_stacks(&self) -> Vec<&StackMetadata>
pub fn get_all_stacks(&self) -> Vec<&StackMetadata>
Get all stacks
Sourcepub fn get_stack_commits(&self, stack_id: &Uuid) -> Vec<&CommitMetadata>
pub fn get_stack_commits(&self, stack_id: &Uuid) -> Vec<&CommitMetadata>
Get all commits for a stack
Sourcepub fn find_stack_by_name(&self, name: &str) -> Option<&StackMetadata>
pub fn find_stack_by_name(&self, name: &str) -> Option<&StackMetadata>
Find stack by name
Trait Implementations§
Source§impl Clone for RepositoryMetadata
impl Clone for RepositoryMetadata
Source§fn clone(&self) -> RepositoryMetadata
fn clone(&self) -> RepositoryMetadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for RepositoryMetadata
impl Debug for RepositoryMetadata
Source§impl<'de> Deserialize<'de> for RepositoryMetadata
impl<'de> Deserialize<'de> for RepositoryMetadata
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 RepositoryMetadata
impl RefUnwindSafe for RepositoryMetadata
impl Send for RepositoryMetadata
impl Sync for RepositoryMetadata
impl Unpin for RepositoryMetadata
impl UnwindSafe for RepositoryMetadata
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> 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>
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