pub struct InteractionRegistry { /* private fields */ }Expand description
Track pending interaction identities and reject stale or duplicate replies.
Implementations§
Source§impl InteractionRegistry
impl InteractionRegistry
Sourcepub fn insert(
&mut self,
interaction: &InteractionRequest,
) -> Result<(), ProtocolError>
pub fn insert( &mut self, interaction: &InteractionRequest, ) -> Result<(), ProtocolError>
Register an interaction id for an exact session and turn.
Sourcepub fn validate(
&self,
response: &InteractionResponse,
) -> Result<(), ProtocolError>
pub fn validate( &self, response: &InteractionResponse, ) -> Result<(), ProtocolError>
Validate a response without consuming the pending interaction.
Sourcepub fn resolve(
&mut self,
response: &InteractionResponse,
) -> Result<(), ProtocolError>
pub fn resolve( &mut self, response: &InteractionResponse, ) -> Result<(), ProtocolError>
Validate and consume exactly one matching response.
Sourcepub fn finish_turn(&mut self, session_id: &str, turn_id: &str)
pub fn finish_turn(&mut self, session_id: &str, turn_id: &str)
Drop all requests for a turn after cancellation or completion.
Sourcepub fn close_session(&mut self, session_id: &str)
pub fn close_session(&mut self, session_id: &str)
Drop all requests for a disconnected session.
Trait Implementations§
Source§impl Debug for InteractionRegistry
impl Debug for InteractionRegistry
Auto Trait Implementations§
impl Forget for InteractionRegistry
impl Freeze for InteractionRegistry
impl RefUnwindSafe for InteractionRegistry
impl Send for InteractionRegistry
impl Sync for InteractionRegistry
impl Unpin for InteractionRegistry
impl UnsafeUnpin for InteractionRegistry
impl UnwindSafe for InteractionRegistry
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
Mutably borrows from an owned value. Read more