pub struct LiveTranscriptIdentity<'a> {
pub provider_item_id: Option<&'a str>,
pub previous_item_id: Option<&'a str>,
pub content_index: Option<u32>,
pub response_id: Option<&'a str>,
pub delta_id: Option<&'a str>,
}Expand description
Runtime-side projection sink consumed by LiveAdapterHost.
This is the seam through which adapter observations become canonical
Meerkat semantic facts. Surfaces (RPC/REST/WASM) provide an implementation
that bridges into meerkat_core::SessionService / EventInjector /
observer streams. Tests use [RecordingProjectionSink] (in this module’s
#[cfg(test)] block) to assert routing decisions deterministically.
Provider-side identity carried alongside a transcript fragment.
All fields are Option<&str> / Option<u32> because the underlying
LiveAdapterObservation variants emit them as #[serde(default, skip_serializing_if = "Option::is_none")] per A11. Bundling them in one
struct keeps sink trait signatures readable and lets sink implementations
pattern-match the fields they care about without the call sites passing
six separate arguments.
Variants:
UserTranscriptFinalcarriesprovider_item_id,previous_item_id,content_index(noresponse_id/delta_id— those are assistant-only).AssistantTextDeltacarries the full set includingresponse_idanddelta_id.AssistantTranscriptFinalcarriesprovider_item_id(always present),previous_item_id,content_index,response_id(nodelta_id— a final is not a delta).
Fields§
§provider_item_id: Option<&'a str>§previous_item_id: Option<&'a str>§content_index: Option<u32>§response_id: Option<&'a str>§delta_id: Option<&'a str>Implementations§
Source§impl<'a> LiveTranscriptIdentity<'a>
impl<'a> LiveTranscriptIdentity<'a>
Sourcepub fn user(
provider_item_id: Option<&'a str>,
previous_item_id: Option<&'a str>,
content_index: Option<u32>,
) -> Self
pub fn user( provider_item_id: Option<&'a str>, previous_item_id: Option<&'a str>, content_index: Option<u32>, ) -> Self
Build identity for a user-side observation (response/delta IDs are
always None on the user side).
Sourcepub fn assistant_delta(
provider_item_id: Option<&'a str>,
previous_item_id: Option<&'a str>,
content_index: Option<u32>,
response_id: Option<&'a str>,
delta_id: Option<&'a str>,
) -> Self
pub fn assistant_delta( provider_item_id: Option<&'a str>, previous_item_id: Option<&'a str>, content_index: Option<u32>, response_id: Option<&'a str>, delta_id: Option<&'a str>, ) -> Self
Build identity for a streaming assistant delta (full set carried).
Sourcepub fn assistant_final(
provider_item_id: &'a str,
previous_item_id: Option<&'a str>,
content_index: Option<u32>,
response_id: Option<&'a str>,
) -> Self
pub fn assistant_final( provider_item_id: &'a str, previous_item_id: Option<&'a str>, content_index: Option<u32>, response_id: Option<&'a str>, ) -> Self
Build identity for an assistant final (no delta_id, but everything
else is meaningful and provider_item_id is required upstream).
Sourcepub fn require_delta_identity(
&self,
) -> Result<DeltaIdentity<'a>, LiveTranscriptIdentityError>
pub fn require_delta_identity( &self, ) -> Result<DeltaIdentity<'a>, LiveTranscriptIdentityError>
Resolve the required identity triple for an assistant delta event
(D199): response_id, delta_id, and item_id (provider item id).
The sink previously coalesced each missing id to an empty string via
unwrap_or_default(), emitting an RealtimeTranscriptEvent whose
identity was empty-string truth — a delta that cannot be bound back to
any response/item. This accessor fails closed: a missing required id
yields a typed LiveTranscriptIdentityError naming the absent field,
so the projection rejects the malformed delta rather than fabricating
empty identity.
Trait Implementations§
Source§impl<'a> Clone for LiveTranscriptIdentity<'a>
impl<'a> Clone for LiveTranscriptIdentity<'a>
Source§fn clone(&self) -> LiveTranscriptIdentity<'a>
fn clone(&self) -> LiveTranscriptIdentity<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for LiveTranscriptIdentity<'a>
Source§impl<'a> Debug for LiveTranscriptIdentity<'a>
impl<'a> Debug for LiveTranscriptIdentity<'a>
Source§impl<'a> Default for LiveTranscriptIdentity<'a>
impl<'a> Default for LiveTranscriptIdentity<'a>
Source§fn default() -> LiveTranscriptIdentity<'a>
fn default() -> LiveTranscriptIdentity<'a>
impl<'a> Eq for LiveTranscriptIdentity<'a>
Source§impl<'a> PartialEq for LiveTranscriptIdentity<'a>
impl<'a> PartialEq for LiveTranscriptIdentity<'a>
Source§fn eq(&self, other: &LiveTranscriptIdentity<'a>) -> bool
fn eq(&self, other: &LiveTranscriptIdentity<'a>) -> bool
self and other values to be equal, and is used by ==.impl<'a> StructuralPartialEq for LiveTranscriptIdentity<'a>
Auto Trait Implementations§
impl<'a> Freeze for LiveTranscriptIdentity<'a>
impl<'a> RefUnwindSafe for LiveTranscriptIdentity<'a>
impl<'a> Send for LiveTranscriptIdentity<'a>
impl<'a> Sync for LiveTranscriptIdentity<'a>
impl<'a> Unpin for LiveTranscriptIdentity<'a>
impl<'a> UnsafeUnpin for LiveTranscriptIdentity<'a>
impl<'a> UnwindSafe for LiveTranscriptIdentity<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.