pub struct LedgerPayloadEnvelope { /* private fields */ }Expand description
LedgerPayloadEnvelope
Logical ledger payload envelope embedded inside one physically committed generation. This layer is decoded after physical dual-slot recovery selects a committed generation and before any allocation-ledger DTO is decoded.
This is an advanced protocol byte wrapper, not an authority token. Decoding
an envelope only classifies the logical payload; authority is established
later when crate::LedgerCommitStore routes the payload, checks
the current ledger format, validates committed ledger integrity, and returns
crate::RecoveredLedger.
Implementations§
Source§impl LedgerPayloadEnvelope
impl LedgerPayloadEnvelope
Sourcepub fn encode(&self) -> Vec<u8> ⓘ
pub fn encode(&self) -> Vec<u8> ⓘ
Manually encode the logical payload envelope.
§Panics
Panics if the payload exceeds the current ledger byte ceiling or its
encoded length cannot be represented. Use try_encode for typed errors.
Sourcepub fn try_encode(&self) -> Result<Vec<u8>, LedgerPayloadEnvelopeError>
pub fn try_encode(&self) -> Result<Vec<u8>, LedgerPayloadEnvelopeError>
Try to encode the logical payload envelope.
Sourcepub fn decode(bytes: &[u8]) -> Result<Self, LedgerPayloadEnvelopeError>
pub fn decode(bytes: &[u8]) -> Result<Self, LedgerPayloadEnvelopeError>
Manually decode the logical payload envelope.