pub struct GenericDeltaSession { /* private fields */ }Expand description
A producer-side helper that manages the re-anchor cadence for a stream of
generic-profile updates (SPEC Section 10a.8, non-normative producer policy).
It is thin sugar over the primitives: each next emits either a compact delta
or, on its chosen cadence, a full re-anchor, updating its held base. It
introduces NO new wire syntax. Not safe for concurrent use.
Implementations§
Source§impl GenericDeltaSession
impl GenericDeltaSession
Sourcepub fn new(base: GenericSet, tool: String, policy: ReanchorPolicy) -> Self
pub fn new(base: GenericSet, tool: String, policy: ReanchorPolicy) -> Self
Start a session anchored on base. Call current_full to get the initial
full payload to transmit, then next for each subsequent state.
Sourcepub fn current_full(&self) -> String
pub fn current_full(&self) -> String
Return the full payload for the current base (encode_generic_full). Send
this first to establish the base; it is also a valid manual re-anchor.
Sourcepub fn turn(&self) -> usize
pub fn turn(&self) -> usize
Return the number of next calls so far (the initial full is turn 0).
Sourcepub fn next(&mut self, next: GenericSet) -> Result<(String, bool), String>
pub fn next(&mut self, next: GenericSet) -> Result<(String, bool), String>
Advance the session by one turn to next, returning the wire to transmit
and whether it is a full re-anchor (true) or a delta (false). A schema
change forces a full (Section 10a.7). The held base becomes next either
way. The wire is byte-identical to calling encode_generic_full /
encode_generic_delta directly.
Trait Implementations§
Source§impl Clone for GenericDeltaSession
impl Clone for GenericDeltaSession
Source§fn clone(&self) -> GenericDeltaSession
fn clone(&self) -> GenericDeltaSession
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more