pub struct MemoryProvenanceEntry {
pub entry_id: String,
pub store: String,
pub key: String,
pub capability_id: String,
pub receipt_id: String,
pub written_at: u64,
pub prev_hash: String,
pub hash: String,
}Expand description
Entry committed to the append-only provenance chain.
hash = sha256_hex(canonical_json(MemoryProvenanceHashInput)), where
the hash input carries every field except hash itself and is
serialised in the canonical-JSON form mandated by the rest of Chio
(RFC 8785 via chio_core::canonical::canonical_json_bytes). The
prev_hash field is baked into the hash input, so replacing or
reordering entries after the fact breaks the chain.
Fields§
§entry_id: StringGlobally unique entry id, assigned by the store.
store: StringMemory store / collection / namespace the write targeted.
key: StringKey, document id, or namespace identifier within store.
Empty string is the canonical “whole-collection” marker.
capability_id: StringCapability id that authorized the write.
receipt_id: StringReceipt id emitted for the write.
written_at: u64Unix seconds at write time.
prev_hash: Stringhash of the previous entry in the chain, or
MEMORY_PROVENANCE_GENESIS_PREV_HASH for the very first entry.
hash: Stringsha256_hex(canonical_json(self_without_hash)). Verified by
recompute_entry_hash.
Implementations§
Source§impl MemoryProvenanceEntry
impl MemoryProvenanceEntry
Sourcepub fn expected_hash(&self) -> Result<String, MemoryProvenanceError>
pub fn expected_hash(&self) -> Result<String, MemoryProvenanceError>
Return the canonical hash for this entry, ignoring the currently
stored hash field. Used by MemoryProvenanceStore::verify_entry
implementations to detect in-place tampering.
Trait Implementations§
Source§impl Clone for MemoryProvenanceEntry
impl Clone for MemoryProvenanceEntry
Source§fn clone(&self) -> MemoryProvenanceEntry
fn clone(&self) -> MemoryProvenanceEntry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MemoryProvenanceEntry
impl Debug for MemoryProvenanceEntry
Source§impl<'de> Deserialize<'de> for MemoryProvenanceEntry
impl<'de> Deserialize<'de> for MemoryProvenanceEntry
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>,
Source§impl PartialEq for MemoryProvenanceEntry
impl PartialEq for MemoryProvenanceEntry
Source§impl Serialize for MemoryProvenanceEntry
impl Serialize for MemoryProvenanceEntry
impl Eq for MemoryProvenanceEntry
impl StructuralPartialEq for MemoryProvenanceEntry
Auto Trait Implementations§
impl Freeze for MemoryProvenanceEntry
impl RefUnwindSafe for MemoryProvenanceEntry
impl Send for MemoryProvenanceEntry
impl Sync for MemoryProvenanceEntry
impl Unpin for MemoryProvenanceEntry
impl UnsafeUnpin for MemoryProvenanceEntry
impl UnwindSafe for MemoryProvenanceEntry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.