pub struct GitMetadataRecord {
pub branch: Option<String>,
pub sha: Option<String>,
pub dirty: bool,
pub captured_at_ms: i64,
}Expand description
One session’s git provenance, best-effort captured at construction time
(Agent::with_parts, gated by Config::session_git_metadata).
Fields§
§branch: Option<String>git rev-parse --abbrev-ref HEAD, if cwd is inside a git repo and
git is on PATH. None otherwise — never blocks capture.
sha: Option<String>git rev-parse HEAD (the full 40-char sha), same availability as
Self::branch.
dirty: boolWhether git status --porcelain reported any changes. false when
git information couldn’t be read at all (an honest “unknown treated
as clean”, matching agent::env_context_git_status’s existing
posture).
captured_at_ms: i64Unix-ms wall-clock time the record was captured.
Trait Implementations§
Source§impl Clone for GitMetadataRecord
impl Clone for GitMetadataRecord
Source§fn clone(&self) -> GitMetadataRecord
fn clone(&self) -> GitMetadataRecord
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 GitMetadataRecord
impl Debug for GitMetadataRecord
Source§impl Default for GitMetadataRecord
impl Default for GitMetadataRecord
Source§fn default() -> GitMetadataRecord
fn default() -> GitMetadataRecord
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for GitMetadataRecord
impl<'de> Deserialize<'de> for GitMetadataRecord
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
Source§impl PartialEq for GitMetadataRecord
impl PartialEq for GitMetadataRecord
Source§impl Serialize for GitMetadataRecord
impl Serialize for GitMetadataRecord
impl StructuralPartialEq for GitMetadataRecord
Auto Trait Implementations§
impl Freeze for GitMetadataRecord
impl RefUnwindSafe for GitMetadataRecord
impl Send for GitMetadataRecord
impl Sync for GitMetadataRecord
impl Unpin for GitMetadataRecord
impl UnsafeUnpin for GitMetadataRecord
impl UnwindSafe for GitMetadataRecord
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