pub struct EnvelopeDeltaDecoder { /* private fields */ }Expand description
Reconstructs compacted provider envelopes as a transcript is read back.
Hold one per served stream and feed it every event in the order the reader will present
them: a base is only available to the deltas that follow it. It remembers a single base per
(stream, agent), mirroring EnvelopeDeltaEncoder exactly.
Implementations§
Source§impl EnvelopeDeltaDecoder
impl EnvelopeDeltaDecoder
Sourcepub fn resolve(&mut self, event: &ActivityEvent) -> ResolvedEnvelope
pub fn resolve(&mut self, event: &ActivityEvent) -> ResolvedEnvelope
Resolves one event, recording it as a base when it is one.
Sourcepub fn resolve_event(
&mut self,
event: &ActivityEvent,
) -> (ActivityEvent, Option<UnresolvedDelta>)
pub fn resolve_event( &mut self, event: &ActivityEvent, ) -> (ActivityEvent, Option<UnresolvedDelta>)
Returns a copy of the event with any delta replaced by the envelope it reconstructs to.
This is the form the server’s transcript serving boundary uses: downstream consumers keep receiving exactly the full envelopes they received before compaction existed. An unresolvable delta is left in place — never fabricated — and reported to the caller so it can be logged where a delta going unresolved is worth knowing about.