pub enum CondensatePayload {
Inline(Value),
Stored(Digest),
}Expand description
Where the summary itself lives.
Small payloads are inlined so reading a condensate needs no store lookup; large ones are referenced, so the ledger does not balloon. The threshold is a policy decision made by the slicer, not a property of the type.
Variants§
Inline(Value)
The summary, carried directly.
Stored(Digest)
The summary, addressed in the content-addressed store.
Implementations§
Source§impl CondensatePayload
impl CondensatePayload
Sourcepub fn inline<T: Serialize>(value: &T) -> Result<Self, CanonicalError>
pub fn inline<T: Serialize>(value: &T) -> Result<Self, CanonicalError>
Build an inline payload from any serialisable value.
§Errors
Returns CanonicalError::Encode if the
value cannot be represented as CBOR.
Trait Implementations§
Source§impl Clone for CondensatePayload
impl Clone for CondensatePayload
Source§impl Debug for CondensatePayload
impl Debug for CondensatePayload
Source§impl<'de> Deserialize<'de> for CondensatePayload
impl<'de> Deserialize<'de> for CondensatePayload
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 CondensatePayload
impl PartialEq for CondensatePayload
Source§impl Serialize for CondensatePayload
impl Serialize for CondensatePayload
impl StructuralPartialEq for CondensatePayload
Auto Trait Implementations§
impl Freeze for CondensatePayload
impl RefUnwindSafe for CondensatePayload
impl Send for CondensatePayload
impl Sync for CondensatePayload
impl Unpin for CondensatePayload
impl UnsafeUnpin for CondensatePayload
impl UnwindSafe for CondensatePayload
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> Canonical for T
impl<T> Canonical for T
Source§fn canonical_bytes(&self) -> Result<Vec<u8>, CanonicalError>
fn canonical_bytes(&self) -> Result<Vec<u8>, CanonicalError>
The canonical CBOR encoding of this value.