pub enum PayloadRef {
Inline(Value),
Artifact(ArtifactRef),
}Expand description
How an event’s input or output payload is carried.
Small values are embedded (PayloadRef::Inline); large values are
content-addressed (PayloadRef::Artifact) with their bytes held in the
journal’s artifact map. The split keeps events cheap to scan (sequences,
causal links, statuses) without forcing payloads out of the snapshot.
Serialized with adjacent tagging ({"kind": "inline", "value": …}):
payloads are arbitrary JSON, so the tag must not be flattened into the
payload the way internal tagging would require.
Variants§
Inline(Value)
The payload itself, embedded in the event.
Artifact(ArtifactRef)
A content hash of the payload; bytes live in the journal snapshot’s artifact map under the same hash.
Implementations§
Source§impl PayloadRef
impl PayloadRef
Sourcepub fn inline(value: Value) -> Self
pub fn inline(value: Value) -> Self
Always-inline reference (test convenience and small-value paths).
Sourcepub fn content_hash(&self) -> Result<String, Error>
pub fn content_hash(&self) -> Result<String, Error>
The content hash of the payload, whether inline or referenced.
Hashing is over the canonical serde_json serialization (object keys
sort deterministically — see canonicalize_value), so equal
payloads hash equal regardless of which representation carried them.
Trait Implementations§
Source§impl Clone for PayloadRef
impl Clone for PayloadRef
Source§fn clone(&self) -> PayloadRef
fn clone(&self) -> PayloadRef
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more