Skip to main content

LogRow

Struct LogRow 

Source
pub struct LogRow {
Show 16 fields pub ts: DateTime<Utc>, pub ts_seq: u64, pub event: LogEvent, pub ref_: Option<String>, pub source: Option<String>, pub result: LogResult, pub license: Option<String>, pub size_bytes: Option<u64>, pub store_path: Option<String>, pub capability: Capability, pub session_id: String, pub error_code: Option<String>, pub schema_version: String, pub canonical_digest: Option<String>, pub prev_hash: String, pub this_hash: String,
}
Expand description

One row of the provenance log (PROVENANCE_LOG.md §3).

The on-disk wire field names match the spec table; struct-field order is not load-bearing for the hash because canonicalization sorts keys lexicographically (see PROVENANCE_LOG.md §4).

Schema version: this struct is the v2 row shape (ADR-0024). Every v2 row carries schema_version = "v2" literally; the canonical_digest field carries the ADR-0021 §1 audit identity of the fetch on rows where one applies (Fetch / Resolve / StoreWrite) and is None on session bookend rows (SessionStart / SessionEnd / CapabilityResolved) that have no ref. v1 rows (pre-Slice-4) lack both fields and MUST be migrated via migrate_v1_to_v2 before the v2 binary can read them — the deny_unknown_fields + non-defaulted schema_version shape ensures v1 rows fail to parse loudly rather than producing silent hash-chain mismatches.

Fields§

§ts: DateTime<Utc>

RFC3339 UTC timestamp of the append (millisecond precision).

§ts_seq: u64

Per-session monotonic sequence number, starting at 1.

§event: LogEvent

Event class (see LogEvent).

§ref_: Option<String>

Optional reference (DOI / arXiv id). Wire field name is ref.

§source: Option<String>

Optional source name (e.g. unpaywall).

§result: LogResult

Result (see LogResult).

§license: Option<String>

OA license string (event=fetch, result=ok); None otherwise.

§size_bytes: Option<u64>

Bytes written / fetched, on success rows.

§store_path: Option<String>

Path to the stored payload, relative to the store root (event=fetch, result=ok); None otherwise.

§capability: Capability

Capability under which the row was written (REQUIRED, every row).

§session_id: String

26-char ULID identifying the process invocation (REQUIRED).

§error_code: Option<String>

Stable error code on failure rows.

§schema_version: String

Row schema version. Always LOG_SCHEMA_VERSION ("v2") for new rows written by this build (ADR-0024). v1 rows lack this field; they MUST be migrated via migrate_v1_to_v2 first.

§canonical_digest: Option<String>

Canonical-digest of the fetch’s audit identity (ADR-0021 §1) as 64 lowercase hex chars. Present on rows with a ref (Fetch, Resolve, StoreWrite); None on session bookend rows. The digest is computed from a crate::CanonicalRef whose resolver_profile matches this row’s source field for migrated v1 rows; new v2 rows MAY pass an explicit resolver_profile distinct from source.

§prev_hash: String

64 lowercase hex chars, OR the literal string "GENESIS" for the first row of a fresh log file.

§this_hash: String

64 lowercase hex chars. SHA-256 of canonical JSON of THIS row with the this_hash field removed. See module docs.

Trait Implementations§

Source§

impl Clone for LogRow

Source§

fn clone(&self) -> LogRow

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LogRow

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for LogRow

Source§

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 Serialize for LogRow

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,