pub enum StoredHistory {
Complete,
Window,
}Expand description
What a provider’s stored history is, which decides which occurrence of it inside a replayed transcript is the one it actually holds.
The distinction only bites when the stored run occurs more than once in the replay — a conversation that repeats an exchange verbatim — and the two answers are opposites, so it is a caller’s decision rather than a guess.
Variants§
Complete
Everything the conversation has said so far, in order: the provider drops nothing. The first occurrence is therefore the stored one, and everything after it is new — matching a later occurrence would discard the genuinely new turns in between.
Window
A retention-limited store’s list, which may be a trimmed window of the most recent messages.
A match at the start still wins, because a list that has not actually been trimmed yet — a first write that happened to fill the cap exactly — is still the complete conversation, and treating it as a window would drop the turns between two occurrences of it. Only when the stored run is not at the start is it searched for, and then the last occurrence is the retained window: matching an earlier one would re-send the whole middle of the transcript on every turn, messages the store is going to trim away again anyway.
The ambiguous case — a genuine window whose content also opens the transcript — resolves to the anchored match, so it re-sends the middle rather than risking a lost turn. That is the right way round: the redundant writes are trimmed away, a dropped turn is not recoverable.
Trait Implementations§
Source§impl Clone for StoredHistory
impl Clone for StoredHistory
Source§fn clone(&self) -> StoredHistory
fn clone(&self) -> StoredHistory
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more