pub struct ChangeMetadata {
pub meta_version: u32,
pub change_id: String,
pub title: Option<String>,
pub status: ChangeStatus,
pub schema: String,
pub notebook: String,
pub created_at: Timestamp,
pub updated_at: Timestamp,
pub repository_commits: Vec<RepositoryCommit>,
}Expand description
The JSON control plane stored in a change’s meta note.
Fields§
§meta_version: u32Meta note format version.
change_id: StringChange identifier (the namespace folder name).
title: Option<String>Human-readable title.
status: ChangeStatusLifecycle status.
schema: StringWorkflow schema name resolved for this change.
notebook: StringSource notebook holding the change.
created_at: TimestampCreation time.
updated_at: TimestampLast update time.
repository_commits: Vec<RepositoryCommit>Commits recorded at repository-writing transitions.
Implementations§
Source§impl ChangeMetadata
impl ChangeMetadata
Sourcepub fn new(
change_id: &str,
title: Option<&str>,
schema: &str,
notebook: &str,
) -> Result<Self, ChangeError>
pub fn new( change_id: &str, title: Option<&str>, schema: &str, notebook: &str, ) -> Result<Self, ChangeError>
Creates metadata for a new draft change stamped with the current time.
§Errors
Returns ChangeError::InvalidChangeId for non-kebab-case ids.
Sourcepub fn transition(&mut self, next: ChangeStatus) -> Result<(), ChangeError>
pub fn transition(&mut self, next: ChangeStatus) -> Result<(), ChangeError>
Moves the change to next and refreshes updated_at.
§Errors
Returns ChangeError::InvalidTransition when the lifecycle
does not permit the move.
Sourcepub fn record_commit(&mut self, commit: &str)
pub fn record_commit(&mut self, commit: &str)
Records a repository commit produced by a repository-writing
operation and refreshes updated_at.
Trait Implementations§
Source§impl Clone for ChangeMetadata
impl Clone for ChangeMetadata
Source§fn clone(&self) -> ChangeMetadata
fn clone(&self) -> ChangeMetadata
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ChangeMetadata
impl Debug for ChangeMetadata
Source§impl<'de> Deserialize<'de> for ChangeMetadata
impl<'de> Deserialize<'de> for ChangeMetadata
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
impl Eq for ChangeMetadata
Source§impl PartialEq for ChangeMetadata
impl PartialEq for ChangeMetadata
Source§impl Serialize for ChangeMetadata
impl Serialize for ChangeMetadata
impl StructuralPartialEq for ChangeMetadata
Auto Trait Implementations§
impl Freeze for ChangeMetadata
impl RefUnwindSafe for ChangeMetadata
impl Send for ChangeMetadata
impl Sync for ChangeMetadata
impl Unpin for ChangeMetadata
impl UnsafeUnpin for ChangeMetadata
impl UnwindSafe for ChangeMetadata
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