pub struct ChunkMetadata {
pub source_type: String,
pub path: Option<String>,
pub commit: Option<String>,
pub author: Option<String>,
pub date: Option<String>,
pub base_offset: usize,
pub mtime_ns: Option<u64>,
pub size_bytes: Option<u64>,
}Expand description
Metadata that tracks the source location for a scanned chunk.
§Examples
use keyhog_core::ChunkMetadata;
let metadata = ChunkMetadata {
source_type: "git-diff".into(),
path: Some("src/lib.rs".into()),
commit: Some("abc123".into()),
author: Some("Dev".into()),
date: Some("2026-03-26T00:00:00Z".into()),
..Default::default()
};
assert_eq!(metadata.source_type, "git-diff");Fields§
§source_type: String§path: Option<String>§commit: Option<String>§date: Option<String>§base_offset: usize§mtime_ns: Option<u64>File mtime in nanoseconds since UNIX epoch, when the source can surface it cheaply (filesystem walks). Optional because non-fs sources (stdin, http, git diffs) don’t have a meaningful mtime. Populated to drive the merkle-index metadata fast-path.
size_bytes: Option<u64>File size in bytes, when known cheaply at chunk-production time.
Same shape and rationale as mtime_ns.
Trait Implementations§
Source§impl Clone for ChunkMetadata
impl Clone for ChunkMetadata
Source§fn clone(&self) -> ChunkMetadata
fn clone(&self) -> ChunkMetadata
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 ChunkMetadata
impl Debug for ChunkMetadata
Source§impl Default for ChunkMetadata
impl Default for ChunkMetadata
Source§fn default() -> ChunkMetadata
fn default() -> ChunkMetadata
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ChunkMetadata
impl RefUnwindSafe for ChunkMetadata
impl Send for ChunkMetadata
impl Sync for ChunkMetadata
impl Unpin for ChunkMetadata
impl UnsafeUnpin for ChunkMetadata
impl UnwindSafe for ChunkMetadata
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