pub struct GitMark {
pub commit_sha: String,
pub repo: String,
pub branch: String,
pub parent: Option<String>,
}Expand description
The cheap-tier git commit captured for a pod write.
Fields§
§commit_sha: StringGit SHA-1 of the commit the write produced.
repo: StringPod repo slug (the pod’s first path segment / pubkey).
branch: StringBranch the commit landed on. Pinned to "main" by init.rs.
parent: Option<String>Prior commit SHA (the append-only chain link), or None for the
genesis commit of a freshly-initialised repo.
Implementations§
Source§impl GitMark
impl GitMark
Sourcepub fn to_gitmark_envelope(
&self,
vout: u32,
genesis_sha: &str,
nick: impl Into<String>,
package: impl Into<String>,
) -> GitMarkEnvelope
pub fn to_gitmark_envelope( &self, vout: u32, genesis_sha: &str, nick: impl Into<String>, package: impl Into<String>, ) -> GitMarkEnvelope
Project this internal GitMark onto the canonical 5-key
gitmark.json envelope (ADR-124, C7).
voutis the seal output index for this mark’s@id(gitmark:<commit_sha>:<vout>).genesis_shais the trail’s first commit SHA; pass this mark’s owncommit_shafor the genesis mark (thengenesis == @id).nick/packageare the additive projection fields;repositorydefaults to./(repo-relative root, matching the ground truth).
branch/parent are intentionally NOT emitted — they are not part of
the on-disk envelope. Parent-linkage is carried by blocktrails.json.
Sourcepub fn to_gitmark_json(
&self,
vout: u32,
genesis_sha: &str,
nick: impl Into<String>,
package: impl Into<String>,
) -> Result<String, ProvenanceError>
pub fn to_gitmark_json( &self, vout: u32, genesis_sha: &str, nick: impl Into<String>, package: impl Into<String>, ) -> Result<String, ProvenanceError>
Serialise this mark to the canonical gitmark.json text (5-key
envelope, ADR-124). Convenience over Self::to_gitmark_envelope +
serde_json::to_string_pretty.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GitMark
impl<'de> Deserialize<'de> for GitMark
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 GitMark
impl StructuralPartialEq for GitMark
Auto Trait Implementations§
impl Freeze for GitMark
impl RefUnwindSafe for GitMark
impl Send for GitMark
impl Sync for GitMark
impl Unpin for GitMark
impl UnsafeUnpin for GitMark
impl UnwindSafe for GitMark
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